/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('smartag', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ActivateSmartAccessGatewayRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-ke3kq4evpi8p6******'),
}

model ActivateSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='E223E535-AE11-4158-B00F-DC107887A909'),
}

model ActivateSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ActivateSmartAccessGatewayResponseBody(name='body'),
}

async function activateSmartAccessGatewayWithOptions(request: ActivateSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): ActivateSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ActivateSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function activateSmartAccessGateway(request: ActivateSmartAccessGatewayRequest): ActivateSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return activateSmartAccessGatewayWithOptions(request, runtime);
}

model ActiveFlowLogRequest {
  flowLogId?: string(name='FlowLogId', example='fl-l934tsa5504yuc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ActiveFlowLogResponseBody = {
  requestId?: string(name='RequestId', example='CBBE5EBF-69C1-4395-B36B-26B7605F87EA'),
}

model ActiveFlowLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ActiveFlowLogResponseBody(name='body'),
}

async function activeFlowLogWithOptions(request: ActiveFlowLogRequest, runtime: Util.RuntimeOptions): ActiveFlowLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ActiveFlowLog',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function activeFlowLog(request: ActiveFlowLogRequest): ActiveFlowLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return activeFlowLogWithOptions(request, runtime);
}

model AddACLRuleRequest {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0n*****'),
  description?: string(name='Description', example='desctest'),
  destCidr?: string(name='DestCidr', example='192.168.10.0/24'),
  destPortRange?: string(name='DestPortRange', example='1/200'),
  direction?: string(name='Direction', example='in'),
  dpiGroupIds?: [ string ](name='DpiGroupIds', example='20'),
  dpiSignatureIds?: [ string ](name='DpiSignatureIds', example='1'),
  ipProtocol?: string(name='IpProtocol', example='tcp'),
  name?: string(name='Name', example='doctest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  policy?: string(name='Policy', example='accept'),
  priority?: int32(name='Priority', example='12'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceCidr?: string(name='SourceCidr', example='192.168.20.0/24'),
  sourcePortRange?: string(name='SourcePortRange', example='1/200'),
  type?: string(name='Type', example='LAN'),
}

model AddACLRuleResponseBody = {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0*******'),
  acrId?: string(name='AcrId', example='acr-c1hkd054qywi******'),
  description?: string(name='Description', example='test'),
  destCidr?: string(name='DestCidr', example='192.168.10.0/24'),
  destPortRange?: string(name='DestPortRange', example='1/65535'),
  direction?: string(name='Direction', example='out'),
  dpiGroupIds?: {
    dpiGroupId?: [ string ](name='DpiGroupId')
  }(name='DpiGroupIds'),
  dpiSignatureIds?: {
    dpiSignatureId?: [ string ](name='DpiSignatureId')
  }(name='DpiSignatureIds'),
  gmtCreate?: long(name='GmtCreate', example='1553766882689'),
  ipProtocol?: string(name='IpProtocol', example='TCP'),
  name?: string(name='Name', example='doctest'),
  policy?: string(name='Policy', example='drop'),
  priority?: int32(name='Priority', example='1'),
  requestId?: string(name='RequestId', example='880F84CB-9B54-4413-A8A3-8832C82D1BC4'),
  sourceCidr?: string(name='SourceCidr', example='192.168.20.0/24'),
  sourcePortRange?: string(name='SourcePortRange', example='1/65535'),
  type?: string(name='Type', example='LAN'),
}

model AddACLRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddACLRuleResponseBody(name='body'),
}

async function addACLRuleWithOptions(request: AddACLRuleRequest, runtime: Util.RuntimeOptions): AddACLRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.destCidr)) {
    query['DestCidr'] = request.destCidr;
  }
  if (!Util.isUnset(request.destPortRange)) {
    query['DestPortRange'] = request.destPortRange;
  }
  if (!Util.isUnset(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!Util.isUnset(request.dpiGroupIds)) {
    query['DpiGroupIds'] = request.dpiGroupIds;
  }
  if (!Util.isUnset(request.dpiSignatureIds)) {
    query['DpiSignatureIds'] = request.dpiSignatureIds;
  }
  if (!Util.isUnset(request.ipProtocol)) {
    query['IpProtocol'] = request.ipProtocol;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceCidr)) {
    query['SourceCidr'] = request.sourceCidr;
  }
  if (!Util.isUnset(request.sourcePortRange)) {
    query['SourcePortRange'] = request.sourcePortRange;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddACLRule',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addACLRule(request: AddACLRuleRequest): AddACLRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return addACLRuleWithOptions(request, runtime);
}

model AddDnatEntryRequest {
  externalIp?: string(name='ExternalIp', example='10.10.1.xx'),
  externalPort?: string(name='ExternalPort', example='80'),
  internalIp?: string(name='InternalIp', example='192.168.0.1'),
  internalPort?: string(name='InternalPort', example='80'),
  ipProtocol?: string(name='IpProtocol', example='TCP'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sagId?: string(name='SagId', example='sag-kdhg*******'),
  type?: string(name='Type', example='Intranet'),
}

model AddDnatEntryResponseBody = {
  dnatEntryId?: string(name='DnatEntryId', example='fwd-kxe4fq3xuzczze****'),
  requestId?: string(name='RequestId', example='56BF6C79-C77D-41A0-86DD-A4B156E784EA'),
}

model AddDnatEntryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddDnatEntryResponseBody(name='body'),
}

async function addDnatEntryWithOptions(request: AddDnatEntryRequest, runtime: Util.RuntimeOptions): AddDnatEntryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.externalIp)) {
    query['ExternalIp'] = request.externalIp;
  }
  if (!Util.isUnset(request.externalPort)) {
    query['ExternalPort'] = request.externalPort;
  }
  if (!Util.isUnset(request.internalIp)) {
    query['InternalIp'] = request.internalIp;
  }
  if (!Util.isUnset(request.internalPort)) {
    query['InternalPort'] = request.internalPort;
  }
  if (!Util.isUnset(request.ipProtocol)) {
    query['IpProtocol'] = request.ipProtocol;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddDnatEntry',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addDnatEntry(request: AddDnatEntryRequest): AddDnatEntryResponse {
  var runtime = new Util.RuntimeOptions{};
  return addDnatEntryWithOptions(request, runtime);
}

model AddSmartAccessGatewayDnsForwardRequest {
  domain?: string(name='Domain', example='www.aliyun.com'),
  masterIp?: string(name='MasterIp', example='114.114.114.114'),
  mode?: string(name='Mode', example='first'),
  outboundPortIndex?: string(name='OutboundPortIndex', example='0'),
  outboundPortName?: string(name='OutboundPortName', example='eth0'),
  outboundPortType?: string(name='OutboundPortType', example='Tunnel'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
  slaveIp?: string(name='SlaveIp', example='172.16.0.14'),
}

model AddSmartAccessGatewayDnsForwardResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    domain?: string(name='Domain', example='yfiy.cn'),
    instanceId?: string(name='InstanceId', example='sagv3dnsforward-nc7qabskj17werc7su'),
    masterIp?: string(name='MasterIp', example='14.104.81.13'),
    mode?: string(name='Mode', example='first'),
    outboundPortIndex?: int32(name='OutboundPortIndex', example='0'),
    outboundPortName?: string(name='OutboundPortName', example='eth0'),
    outboundPortType?: string(name='OutboundPortType', example='PhysicalPort'),
    slaveIp?: string(name='SlaveIp', example='172.16.0.14'),
  }(name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='E93884AC-6C21-4FEA-8E3A-7377D33B194F'),
  success?: boolean(name='Success', example='true'),
}

model AddSmartAccessGatewayDnsForwardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddSmartAccessGatewayDnsForwardResponseBody(name='body'),
}

async function addSmartAccessGatewayDnsForwardWithOptions(request: AddSmartAccessGatewayDnsForwardRequest, runtime: Util.RuntimeOptions): AddSmartAccessGatewayDnsForwardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.masterIp)) {
    query['MasterIp'] = request.masterIp;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.outboundPortIndex)) {
    query['OutboundPortIndex'] = request.outboundPortIndex;
  }
  if (!Util.isUnset(request.outboundPortName)) {
    query['OutboundPortName'] = request.outboundPortName;
  }
  if (!Util.isUnset(request.outboundPortType)) {
    query['OutboundPortType'] = request.outboundPortType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  if (!Util.isUnset(request.slaveIp)) {
    query['SlaveIp'] = request.slaveIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddSmartAccessGatewayDnsForward',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addSmartAccessGatewayDnsForward(request: AddSmartAccessGatewayDnsForwardRequest): AddSmartAccessGatewayDnsForwardResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSmartAccessGatewayDnsForwardWithOptions(request, runtime);
}

model AddSnatEntryRequest {
  cidrBlock?: string(name='CidrBlock', example='192.168.1.0/24'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-jf5w9a8k5mhi5h****'),
  snatIp?: string(name='SnatIp', example='11.0.XX.XX'),
}

model AddSnatEntryResponseBody = {
  instanceId?: string(name='InstanceId', example='snat-m2obgkt5ya1puz****'),
  requestId?: string(name='RequestId', example='56BF6C79-C77D-41A0-86DD-A4B156E784EA'),
}

model AddSnatEntryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddSnatEntryResponseBody(name='body'),
}

async function addSnatEntryWithOptions(request: AddSnatEntryRequest, runtime: Util.RuntimeOptions): AddSnatEntryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidrBlock)) {
    query['CidrBlock'] = request.cidrBlock;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.snatIp)) {
    query['SnatIp'] = request.snatIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddSnatEntry',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addSnatEntry(request: AddSnatEntryRequest): AddSnatEntryResponse {
  var runtime = new Util.RuntimeOptions{};
  return addSnatEntryWithOptions(request, runtime);
}

model AssociateACLRequest {
  aclId?: string(name='AclId', example='acl-ohlexqptfhy******'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-4yr0p2xa6o3k*******'),
}

model AssociateACLResponseBody = {
  requestId?: string(name='RequestId', example='C9A75915-0260-4335-851A-D866A7ED396C'),
}

model AssociateACLResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AssociateACLResponseBody(name='body'),
}

async function associateACLWithOptions(request: AssociateACLRequest, runtime: Util.RuntimeOptions): AssociateACLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateACL',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateACL(request: AssociateACLRequest): AssociateACLResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateACLWithOptions(request, runtime);
}

model AssociateFlowLogRequest {
  flowLogId?: string(name='FlowLogId', example='fl-l934tsa5504yuc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-39u6j9a49i03wk****'),
}

model AssociateFlowLogResponseBody = {
  requestId?: string(name='RequestId', example='A6E1680B-B34F-4BB7-B504-F8ED675E721C'),
}

model AssociateFlowLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AssociateFlowLogResponseBody(name='body'),
}

async function associateFlowLogWithOptions(request: AssociateFlowLogRequest, runtime: Util.RuntimeOptions): AssociateFlowLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateFlowLog',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateFlowLog(request: AssociateFlowLogRequest): AssociateFlowLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateFlowLogWithOptions(request, runtime);
}

model AssociateQosRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosId?: string(name='QosId', example='qos-awfxl1adxeqyk****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-c3m3n1khz58l****'),
}

model AssociateQosResponseBody = {
  requestId?: string(name='RequestId', example='551CD836-9E46-4F2C-A167-B4363180A647'),
}

model AssociateQosResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AssociateQosResponseBody(name='body'),
}

async function associateQosWithOptions(request: AssociateQosRequest, runtime: Util.RuntimeOptions): AssociateQosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateQos',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateQos(request: AssociateQosRequest): AssociateQosResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateQosWithOptions(request, runtime);
}

model AssociateSmartAGWithApplicationBandwidthPackageRequest {
  applicationBandwidthPackageId?: string(name='ApplicationBandwidthPackageId', example='abwp-7963l7iqnquyj3****'),
  associateConfigs?: [ 
    {
      bandwidth?: int32(name='Bandwidth', example='2'),
      smartAGId?: string(name='SmartAGId', example='sag-gf5serujbhrn2j****'),
    }
  ](name='AssociateConfigs'),
  clientToken?: string(name='ClientToken', example='02fb3da4-130e-11e9-8e44-001****'),
  dryRun?: boolean(name='DryRun', example='false'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model AssociateSmartAGWithApplicationBandwidthPackageResponseBody = {
  requestId?: string(name='RequestId', example='AFF2FD9D-66BD-4DD4-8152-C4508119D7B1'),
}

model AssociateSmartAGWithApplicationBandwidthPackageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AssociateSmartAGWithApplicationBandwidthPackageResponseBody(name='body'),
}

async function associateSmartAGWithApplicationBandwidthPackageWithOptions(request: AssociateSmartAGWithApplicationBandwidthPackageRequest, runtime: Util.RuntimeOptions): AssociateSmartAGWithApplicationBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationBandwidthPackageId)) {
    query['ApplicationBandwidthPackageId'] = request.applicationBandwidthPackageId;
  }
  if (!Util.isUnset(request.associateConfigs)) {
    query['AssociateConfigs'] = request.associateConfigs;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AssociateSmartAGWithApplicationBandwidthPackage',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function associateSmartAGWithApplicationBandwidthPackage(request: AssociateSmartAGWithApplicationBandwidthPackageRequest): AssociateSmartAGWithApplicationBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return associateSmartAGWithApplicationBandwidthPackageWithOptions(request, runtime);
}

model BindSerialNumberRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sage62x021922****'),
  smartAGId?: string(name='SmartAGId', example='sag-r79m060r6oy55******'),
}

model BindSerialNumberResponseBody = {
  requestId?: string(name='RequestId', example='61C33444-D8C5-4018-A06C-BA8C8812BEF6'),
}

model BindSerialNumberResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindSerialNumberResponseBody(name='body'),
}

async function bindSerialNumberWithOptions(request: BindSerialNumberRequest, runtime: Util.RuntimeOptions): BindSerialNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindSerialNumber',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindSerialNumber(request: BindSerialNumberRequest): BindSerialNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindSerialNumberWithOptions(request, runtime);
}

model BindSmartAccessGatewayRequest {
  ccnId?: string(name='CcnId', example='ccn-isdjvvkexkrpk*****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-m7ez44zpayma*****'),
  smartAGUid?: long(name='SmartAGUid', example='1250123456123456'),
}

model BindSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='8A3FF8DD-B27D-4ED2-B032-5EF90B38195D'),
}

model BindSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindSmartAccessGatewayResponseBody(name='body'),
}

async function bindSmartAccessGatewayWithOptions(request: BindSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): BindSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnId)) {
    query['CcnId'] = request.ccnId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGUid)) {
    query['SmartAGUid'] = request.smartAGUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindSmartAccessGateway(request: BindSmartAccessGatewayRequest): BindSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindSmartAccessGatewayWithOptions(request, runtime);
}

model BindVbrRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-eoqbp1fmrsgbrn****'),
  smartAGUid?: long(name='SmartAGUid', example='1250123456123456'),
  vbrId?: string(name='VbrId', example='vbr-gc7ccdvtp3l4fec0j****'),
  vbrRegionId?: string(name='VbrRegionId', example='cn-hangzhou'),
}

model BindVbrResponseBody = {
  requestId?: string(name='RequestId', example='09A2010F-602B-4EC6-A60F-9914AAE2DCA0'),
}

model BindVbrResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindVbrResponseBody(name='body'),
}

async function bindVbrWithOptions(request: BindVbrRequest, runtime: Util.RuntimeOptions): BindVbrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGUid)) {
    query['SmartAGUid'] = request.smartAGUid;
  }
  if (!Util.isUnset(request.vbrId)) {
    query['VbrId'] = request.vbrId;
  }
  if (!Util.isUnset(request.vbrRegionId)) {
    query['VbrRegionId'] = request.vbrRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BindVbr',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function bindVbr(request: BindVbrRequest): BindVbrResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindVbrWithOptions(request, runtime);
}

model ClearSagCipherRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sagId?: string(name='SagId', example='sag-0nnteglltw6z4b****'),
  snNumber?: string(name='SnNumber', example='sag42c3****'),
}

model ClearSagCipherResponseBody = {
  requestId?: string(name='RequestId', example='3712F0B2-721E-4FBF-BBEF-888E3BFE0A20'),
}

model ClearSagCipherResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ClearSagCipherResponseBody(name='body'),
}

async function clearSagCipherWithOptions(request: ClearSagCipherRequest, runtime: Util.RuntimeOptions): ClearSagCipherResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.snNumber)) {
    query['SnNumber'] = request.snNumber;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClearSagCipher',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clearSagCipher(request: ClearSagCipherRequest): ClearSagCipherResponse {
  var runtime = new Util.RuntimeOptions{};
  return clearSagCipherWithOptions(request, runtime);
}

model ClearSagRouteableAddressRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sagId?: string(name='SagId', example='sag-0phdojgu5tqr1p****'),
}

model ClearSagRouteableAddressResponseBody = {
  requestId?: string(name='RequestId', example='AEEC8A5A-360E-4865-82D4-38CDE46445FB'),
}

model ClearSagRouteableAddressResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ClearSagRouteableAddressResponseBody(name='body'),
}

async function clearSagRouteableAddressWithOptions(request: ClearSagRouteableAddressRequest, runtime: Util.RuntimeOptions): ClearSagRouteableAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClearSagRouteableAddress',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clearSagRouteableAddress(request: ClearSagRouteableAddressRequest): ClearSagRouteableAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return clearSagRouteableAddressWithOptions(request, runtime);
}

model CreateACLRequest {
  aclType?: string(name='AclType', example='acl-hardware'),
  name?: string(name='Name', example='username'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateACLResponseBody = {
  aclId?: string(name='AclId', example='acl-o6yol7zowii5n2****'),
  aclType?: string(name='AclType', example='acl-hardware'),
  requestId?: string(name='RequestId', example='EE837E9F-BD50-4C2B-9E47-260F9D848480'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
}

model CreateACLResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateACLResponseBody(name='body'),
}

async function createACLWithOptions(request: CreateACLRequest, runtime: Util.RuntimeOptions): CreateACLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclType)) {
    query['AclType'] = request.aclType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateACL',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createACL(request: CreateACLRequest): CreateACLResponse {
  var runtime = new Util.RuntimeOptions{};
  return createACLWithOptions(request, runtime);
}

model CreateCloudConnectNetworkRequest {
  cidrBlock?: string(name='CidrBlock', example='172.XX.XX.0/24'),
  description?: string(name='Description', example='ccndesc'),
  name?: string(name='Name', example='ccnname'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  snatCidrBlock?: string(name='SnatCidrBlock', example='172.XX.XX.0/25'),
}

model CreateCloudConnectNetworkResponseBody = {
  ccnId?: string(name='CcnId', example='ccn-l9340rlu5ens*****'),
  cidrBlock?: string(name='CidrBlock', example='172.XX.XX.0/24'),
  description?: string(name='Description', example='ccndesc'),
  name?: string(name='Name', example='ccnname'),
  requestId?: string(name='RequestId', example='C48E8EB2-37A4-495B-A95C-29CA1FD26C82'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
  snatCidrBlock?: string(name='SnatCidrBlock', example='172.XX.XX.0/25'),
  status?: string(name='Status', example='Active'),
}

model CreateCloudConnectNetworkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateCloudConnectNetworkResponseBody(name='body'),
}

async function createCloudConnectNetworkWithOptions(request: CreateCloudConnectNetworkRequest, runtime: Util.RuntimeOptions): CreateCloudConnectNetworkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidrBlock)) {
    query['CidrBlock'] = request.cidrBlock;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.snatCidrBlock)) {
    query['SnatCidrBlock'] = request.snatCidrBlock;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCloudConnectNetwork',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCloudConnectNetwork(request: CreateCloudConnectNetworkRequest): CreateCloudConnectNetworkResponse {
  var runtime = new Util.RuntimeOptions{};
  return createCloudConnectNetworkWithOptions(request, runtime);
}

model CreateEnterpriseCodeRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4****'),
  enterpriseCode?: string(name='EnterpriseCode', example='12P**'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model CreateEnterpriseCodeResponseBody = {
  requestId?: string(name='RequestId', example='FBDB18D8-E91E-4978-8D6C-6E2E3EE10133'),
}

model CreateEnterpriseCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateEnterpriseCodeResponseBody(name='body'),
}

async function createEnterpriseCodeWithOptions(request: CreateEnterpriseCodeRequest, runtime: Util.RuntimeOptions): CreateEnterpriseCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enterpriseCode)) {
    query['EnterpriseCode'] = request.enterpriseCode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateEnterpriseCode',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createEnterpriseCode(request: CreateEnterpriseCodeRequest): CreateEnterpriseCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return createEnterpriseCodeWithOptions(request, runtime);
}

model CreateFlowLogRequest {
  activeAging?: int32(name='ActiveAging', example='300'),
  description?: string(name='Description', example='test'),
  inactiveAging?: int32(name='InactiveAging', example='15'),
  logstoreName?: string(name='LogstoreName', example='config-operation-log'),
  name?: string(name='Name', example='sag-flowlog-1'),
  netflowServerIp?: string(name='NetflowServerIp', example='192.168.0.2'),
  netflowServerPort?: int32(name='NetflowServerPort', example='9995'),
  netflowVersion?: string(name='NetflowVersion', example='V9'),
  outputType?: string(name='OutputType', example='all'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  projectName?: string(name='ProjectName', example='sag-flowlog-shanghai'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  slsRegionId?: string(name='SlsRegionId', example='cn-shanghai'),
}

model CreateFlowLogResponseBody = {
  flowLogId?: string(name='FlowLogId', example='fl-7a56mar1kfw9vj****'),
  requestId?: string(name='RequestId', example='650CB9E8-20F3-4538-A4FC-1DA1B36E42D9'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4f****'),
}

model CreateFlowLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateFlowLogResponseBody(name='body'),
}

async function createFlowLogWithOptions(request: CreateFlowLogRequest, runtime: Util.RuntimeOptions): CreateFlowLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.activeAging)) {
    query['ActiveAging'] = request.activeAging;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.inactiveAging)) {
    query['InactiveAging'] = request.inactiveAging;
  }
  if (!Util.isUnset(request.logstoreName)) {
    query['LogstoreName'] = request.logstoreName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.netflowServerIp)) {
    query['NetflowServerIp'] = request.netflowServerIp;
  }
  if (!Util.isUnset(request.netflowServerPort)) {
    query['NetflowServerPort'] = request.netflowServerPort;
  }
  if (!Util.isUnset(request.netflowVersion)) {
    query['NetflowVersion'] = request.netflowVersion;
  }
  if (!Util.isUnset(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.slsRegionId)) {
    query['SlsRegionId'] = request.slsRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateFlowLog',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createFlowLog(request: CreateFlowLogRequest): CreateFlowLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return createFlowLogWithOptions(request, runtime);
}

model CreateHealthCheckRequest {
  description?: string(name='Description', example='hc_123'),
  dstIpAddr?: string(name='DstIpAddr', example='192.XX.XX.1'),
  dstPort?: int32(name='DstPort', example='1333'),
  failCountThreshold?: int32(name='FailCountThreshold', example='3'),
  name?: string(name='Name', example='hc-123'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  probeCount?: int32(name='ProbeCount', example='1'),
  probeInterval?: int32(name='ProbeInterval', example='2000'),
  probeTimeout?: int32(name='ProbeTimeout', example='1000'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  rttFailThreshold?: int32(name='RttFailThreshold', example='3'),
  rttThreshold?: int32(name='RttThreshold', example='1000'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
  srcIpAddr?: string(name='SrcIpAddr', example='10.XX.XX.1'),
  srcPort?: int32(name='SrcPort', example='1344'),
  type?: string(name='Type', example='ICMP_ECHO'),
}

model CreateHealthCheckResponseBody = {
  instanceId?: string(name='InstanceId', example='hc-rrqoucina3gmpn****'),
  requestId?: string(name='RequestId', example='E38E950D-28A4-4C41-9428-A8908EC6AE5C'),
}

model CreateHealthCheckResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateHealthCheckResponseBody(name='body'),
}

async function createHealthCheckWithOptions(request: CreateHealthCheckRequest, runtime: Util.RuntimeOptions): CreateHealthCheckResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dstIpAddr)) {
    query['DstIpAddr'] = request.dstIpAddr;
  }
  if (!Util.isUnset(request.dstPort)) {
    query['DstPort'] = request.dstPort;
  }
  if (!Util.isUnset(request.failCountThreshold)) {
    query['FailCountThreshold'] = request.failCountThreshold;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.probeCount)) {
    query['ProbeCount'] = request.probeCount;
  }
  if (!Util.isUnset(request.probeInterval)) {
    query['ProbeInterval'] = request.probeInterval;
  }
  if (!Util.isUnset(request.probeTimeout)) {
    query['ProbeTimeout'] = request.probeTimeout;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.rttFailThreshold)) {
    query['RttFailThreshold'] = request.rttFailThreshold;
  }
  if (!Util.isUnset(request.rttThreshold)) {
    query['RttThreshold'] = request.rttThreshold;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.srcIpAddr)) {
    query['SrcIpAddr'] = request.srcIpAddr;
  }
  if (!Util.isUnset(request.srcPort)) {
    query['SrcPort'] = request.srcPort;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateHealthCheck',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createHealthCheck(request: CreateHealthCheckRequest): CreateHealthCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHealthCheckWithOptions(request, runtime);
}

model CreateProbeTaskRequest {
  domain?: string(name='Domain'),
  enable?: boolean(name='Enable'),
  packetNumber?: int32(name='PacketNumber'),
  port?: int32(name='Port'),
  probeTaskSourceAddress?: string(name='ProbeTaskSourceAddress'),
  protocol?: string(name='Protocol'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sn?: string(name='Sn'),
  taskName?: string(name='TaskName'),
  type?: string(name='Type'),
}

model CreateProbeTaskResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateProbeTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateProbeTaskResponseBody(name='body'),
}

async function createProbeTaskWithOptions(request: CreateProbeTaskRequest, runtime: Util.RuntimeOptions): CreateProbeTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.packetNumber)) {
    query['PacketNumber'] = request.packetNumber;
  }
  if (!Util.isUnset(request.port)) {
    query['Port'] = request.port;
  }
  if (!Util.isUnset(request.probeTaskSourceAddress)) {
    query['ProbeTaskSourceAddress'] = request.probeTaskSourceAddress;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateProbeTask',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createProbeTask(request: CreateProbeTaskRequest): CreateProbeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return createProbeTaskWithOptions(request, runtime);
}

model CreateQosRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosDescription?: string(name='QosDescription', example='testdesc'),
  qosName?: string(name='QosName', example='doctest'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateQosResponseBody = {
  qosId?: string(name='QosId', example='rg-acfm2iu4fnc****'),
  requestId?: string(name='RequestId', example='AACF5140-783D-48F0-9E4F-E59D716F7D08'),
  resourceGroupId?: string(name='ResourceGroupId', example='qos-oek3r2cmvk7m8q****'),
}

model CreateQosResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateQosResponseBody(name='body'),
}

async function createQosWithOptions(request: CreateQosRequest, runtime: Util.RuntimeOptions): CreateQosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosDescription)) {
    query['QosDescription'] = request.qosDescription;
  }
  if (!Util.isUnset(request.qosName)) {
    query['QosName'] = request.qosName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateQos',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createQos(request: CreateQosRequest): CreateQosResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQosWithOptions(request, runtime);
}

model CreateQosCarRequest {
  description?: string(name='Description', example='Qosdesc'),
  limitType?: string(name='LimitType', example='Absolute'),
  maxBandwidthAbs?: int32(name='MaxBandwidthAbs', example='6'),
  maxBandwidthPercent?: int32(name='MaxBandwidthPercent', example='90'),
  minBandwidthAbs?: int32(name='MinBandwidthAbs', example='2'),
  minBandwidthPercent?: int32(name='MinBandwidthPercent', example='20'),
  name?: string(name='Name', example='nametest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  percentSourceType?: string(name='PercentSourceType', example='CcnBandwidth'),
  priority?: int32(name='Priority', example='2'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateQosCarResponseBody = {
  description?: string(name='Description', example='Qosdesc'),
  limitType?: string(name='LimitType', example='Percent'),
  maxBandwidthAbs?: int32(name='MaxBandwidthAbs', example='6'),
  maxBandwidthPercent?: int32(name='MaxBandwidthPercent', example='90'),
  minBandwidthAbs?: int32(name='MinBandwidthAbs', example='2'),
  minBandwidthPercent?: int32(name='MinBandwidthPercent', example='20'),
  percentSourceType?: string(name='PercentSourceType', example='CcnBandwidth'),
  priority?: int32(name='Priority', example='2'),
  qosCarId?: string(name='QosCarId', example='qoscar-n5k8g97lihlph****'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  requestId?: string(name='RequestId', example='AC13E8FF-4D61-40AD-868E-817F2D3AC86A'),
}

model CreateQosCarResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateQosCarResponseBody(name='body'),
}

async function createQosCarWithOptions(request: CreateQosCarRequest, runtime: Util.RuntimeOptions): CreateQosCarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.limitType)) {
    query['LimitType'] = request.limitType;
  }
  if (!Util.isUnset(request.maxBandwidthAbs)) {
    query['MaxBandwidthAbs'] = request.maxBandwidthAbs;
  }
  if (!Util.isUnset(request.maxBandwidthPercent)) {
    query['MaxBandwidthPercent'] = request.maxBandwidthPercent;
  }
  if (!Util.isUnset(request.minBandwidthAbs)) {
    query['MinBandwidthAbs'] = request.minBandwidthAbs;
  }
  if (!Util.isUnset(request.minBandwidthPercent)) {
    query['MinBandwidthPercent'] = request.minBandwidthPercent;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.percentSourceType)) {
    query['PercentSourceType'] = request.percentSourceType;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateQosCar',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createQosCar(request: CreateQosCarRequest): CreateQosCarResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQosCarWithOptions(request, runtime);
}

model CreateQosPolicyRequest {
  description?: string(name='Description', example='desctest'),
  destCidr?: string(name='DestCidr', example='10.10.20.0/24'),
  destPortRange?: string(name='DestPortRange', example='80/80'),
  dpiGroupIds?: [ string ](name='DpiGroupIds', example='20'),
  dpiSignatureIds?: [ string ](name='DpiSignatureIds', example='1'),
  endTime?: string(name='EndTime', example='2022-09-14T16:41:33+0800'),
  ipProtocol?: string(name='IpProtocol', example='TCP'),
  name?: string(name='Name', example='nametest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  priority?: int32(name='Priority', example='3'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceCidr?: string(name='SourceCidr', example='10.10.10.0/24'),
  sourcePortRange?: string(name='SourcePortRange', example='80/80'),
  startTime?: string(name='StartTime', example='2022-07-14T16:41:33+0800'),
}

model CreateQosPolicyResponseBody = {
  description?: string(name='Description', example='desctest'),
  destCidr?: string(name='DestCidr', example='10.10.10.0/24'),
  destPortRange?: string(name='DestPortRange', example='80/80'),
  dpiGroupIds?: {
    dpiGroupId?: [ string ](name='DpiGroupId')
  }(name='DpiGroupIds'),
  dpiSignatureIds?: {
    dpiSignatureId?: [ string ](name='DpiSignatureId')
  }(name='DpiSignatureIds'),
  endTime?: string(name='EndTime', example='2022-09-14T16:41:33+0800'),
  ipProtocol?: string(name='IpProtocol', example='TCP'),
  name?: string(name='Name', example='nametest'),
  priority?: int32(name='Priority', example='3'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  qosPolicyId?: string(name='QosPolicyId', example='qospy-xhwhyuo43l********'),
  requestId?: string(name='RequestId', example='97862812-2C7E-4D25-B0D5-B26DAC7FA293'),
  sourceCidr?: string(name='SourceCidr', example='10.10.10.0/24'),
  sourcePortRange?: string(name='SourcePortRange', example='80/80'),
  startTime?: string(name='StartTime', example='2022-07-14T16:41:33+0800'),
}

model CreateQosPolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateQosPolicyResponseBody(name='body'),
}

async function createQosPolicyWithOptions(request: CreateQosPolicyRequest, runtime: Util.RuntimeOptions): CreateQosPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.destCidr)) {
    query['DestCidr'] = request.destCidr;
  }
  if (!Util.isUnset(request.destPortRange)) {
    query['DestPortRange'] = request.destPortRange;
  }
  if (!Util.isUnset(request.dpiGroupIds)) {
    query['DpiGroupIds'] = request.dpiGroupIds;
  }
  if (!Util.isUnset(request.dpiSignatureIds)) {
    query['DpiSignatureIds'] = request.dpiSignatureIds;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ipProtocol)) {
    query['IpProtocol'] = request.ipProtocol;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceCidr)) {
    query['SourceCidr'] = request.sourceCidr;
  }
  if (!Util.isUnset(request.sourcePortRange)) {
    query['SourcePortRange'] = request.sourcePortRange;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateQosPolicy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createQosPolicy(request: CreateQosPolicyRequest): CreateQosPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return createQosPolicyWithOptions(request, runtime);
}

model CreateSagExpressConnectInterfaceRequest {
  IP?: string(name='IP', example='192.XX.XX.1'),
  mask?: string(name='Mask', example='255.255.255.252'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='5'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='10'),
}

model CreateSagExpressConnectInterfaceResponseBody = {
  requestId?: string(name='RequestId', example='AFF7E5A6-6897-4FDC-A5A8-1978B5B3E545'),
}

model CreateSagExpressConnectInterfaceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSagExpressConnectInterfaceResponseBody(name='body'),
}

async function createSagExpressConnectInterfaceWithOptions(request: CreateSagExpressConnectInterfaceRequest, runtime: Util.RuntimeOptions): CreateSagExpressConnectInterfaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.IP)) {
    query['IP'] = request.IP;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSagExpressConnectInterface',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSagExpressConnectInterface(request: CreateSagExpressConnectInterfaceRequest): CreateSagExpressConnectInterfaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSagExpressConnectInterfaceWithOptions(request, runtime);
}

model CreateSagStaticRouteRequest {
  destinationCidr?: string(name='DestinationCidr', example='192.XX.XX.0/24'),
  nextHop?: string(name='NextHop', example='192.XX.XX.1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='0'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='20'),
}

model CreateSagStaticRouteResponseBody = {
  requestId?: string(name='RequestId', example='1120228A-E5E1-4E9C-B56D-96887E1A2B2F'),
}

model CreateSagStaticRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSagStaticRouteResponseBody(name='body'),
}

async function createSagStaticRouteWithOptions(request: CreateSagStaticRouteRequest, runtime: Util.RuntimeOptions): CreateSagStaticRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationCidr)) {
    query['DestinationCidr'] = request.destinationCidr;
  }
  if (!Util.isUnset(request.nextHop)) {
    query['NextHop'] = request.nextHop;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSagStaticRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSagStaticRoute(request: CreateSagStaticRouteRequest): CreateSagStaticRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSagStaticRouteWithOptions(request, runtime);
}

model CreateServiceAddressRequest {
  address?: string(name='Address'),
  addressType?: string(name='AddressType'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sn?: string(name='Sn'),
}

model CreateServiceAddressResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model CreateServiceAddressResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateServiceAddressResponseBody(name='body'),
}

async function createServiceAddressWithOptions(request: CreateServiceAddressRequest, runtime: Util.RuntimeOptions): CreateServiceAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceAddress',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createServiceAddress(request: CreateServiceAddressRequest): CreateServiceAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceAddressWithOptions(request, runtime);
}

model CreateSmartAccessGatewayRequest {
  alreadyHaveSag?: boolean(name='AlreadyHaveSag', example='false'),
  autoPay?: boolean(name='AutoPay', example='false'),
  buyerMessage?: string(name='BuyerMessage'),
  CPEVersion?: string(name='CPEVersion', example='basic'),
  chargeType?: string(name='ChargeType', example='PREPAY'),
  description?: string(name='Description', example='testdesc'),
  haType?: string(name='HaType', example='no_backup'),
  hardWareSpec?: string(name='HardWareSpec', example='sag-100wm'),
  maxBandWidth?: int32(name='MaxBandWidth', example='12'),
  name?: string(name='Name', example='testname'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period', example='12'),
  receiverAddress?: string(name='ReceiverAddress'),
  receiverCity?: string(name='ReceiverCity'),
  receiverCountry?: string(name='ReceiverCountry'),
  receiverDistrict?: string(name='ReceiverDistrict'),
  receiverEmail?: string(name='ReceiverEmail', example='xx@example.com'),
  receiverMobile?: string(name='ReceiverMobile', example='1884085****'),
  receiverName?: string(name='ReceiverName'),
  receiverPhone?: string(name='ReceiverPhone', example='8585****'),
  receiverState?: string(name='ReceiverState'),
  receiverTown?: string(name='ReceiverTown'),
  receiverZip?: string(name='ReceiverZip', example='310000'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateSmartAccessGatewayResponseBody = {
  description?: string(name='Description', example='testdesc'),
  name?: string(name='Name', example='testname'),
  orderId?: string(name='OrderId', example='20337777****'),
  requestId?: string(name='RequestId', example='A6B9EB0F-57DB-4843-A372-04678ABF490E'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
  smartAGId?: string(name='SmartAGId', example='sag-nylv14tghsk26c*****'),
}

model CreateSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSmartAccessGatewayResponseBody(name='body'),
}

async function createSmartAccessGatewayWithOptions(request: CreateSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): CreateSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.alreadyHaveSag)) {
    query['AlreadyHaveSag'] = request.alreadyHaveSag;
  }
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.buyerMessage)) {
    query['BuyerMessage'] = request.buyerMessage;
  }
  if (!Util.isUnset(request.CPEVersion)) {
    query['CPEVersion'] = request.CPEVersion;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.haType)) {
    query['HaType'] = request.haType;
  }
  if (!Util.isUnset(request.hardWareSpec)) {
    query['HardWareSpec'] = request.hardWareSpec;
  }
  if (!Util.isUnset(request.maxBandWidth)) {
    query['MaxBandWidth'] = request.maxBandWidth;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.receiverAddress)) {
    query['ReceiverAddress'] = request.receiverAddress;
  }
  if (!Util.isUnset(request.receiverCity)) {
    query['ReceiverCity'] = request.receiverCity;
  }
  if (!Util.isUnset(request.receiverCountry)) {
    query['ReceiverCountry'] = request.receiverCountry;
  }
  if (!Util.isUnset(request.receiverDistrict)) {
    query['ReceiverDistrict'] = request.receiverDistrict;
  }
  if (!Util.isUnset(request.receiverEmail)) {
    query['ReceiverEmail'] = request.receiverEmail;
  }
  if (!Util.isUnset(request.receiverMobile)) {
    query['ReceiverMobile'] = request.receiverMobile;
  }
  if (!Util.isUnset(request.receiverName)) {
    query['ReceiverName'] = request.receiverName;
  }
  if (!Util.isUnset(request.receiverPhone)) {
    query['ReceiverPhone'] = request.receiverPhone;
  }
  if (!Util.isUnset(request.receiverState)) {
    query['ReceiverState'] = request.receiverState;
  }
  if (!Util.isUnset(request.receiverTown)) {
    query['ReceiverTown'] = request.receiverTown;
  }
  if (!Util.isUnset(request.receiverZip)) {
    query['ReceiverZip'] = request.receiverZip;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSmartAccessGateway(request: CreateSmartAccessGatewayRequest): CreateSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSmartAccessGatewayWithOptions(request, runtime);
}

model CreateSmartAccessGatewayClientUserRequest {
  bandwidth?: long(name='Bandwidth', example='20'),
  clientIp?: string(name='ClientIp', example='10.0.XX.XX'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='duuf****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-gnhe6sywtare5****'),
  userMail?: string(name='UserMail', example='username@example.com'),
  userName?: string(name='UserName', example='doctest'),
}

model CreateSmartAccessGatewayClientUserResponseBody = {
  bandwidth?: int32(name='Bandwidth', example='20'),
  clientIp?: string(name='ClientIp', example='10.0.XX.XX'),
  requestId?: string(name='RequestId', example='72E82F5E-66E8-4C22-BF1F-5CEB7DC132E7'),
  userMail?: string(name='UserMail', example='username@example.com'),
  userName?: string(name='UserName', example='doc'),
}

model CreateSmartAccessGatewayClientUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSmartAccessGatewayClientUserResponseBody(name='body'),
}

async function createSmartAccessGatewayClientUserWithOptions(request: CreateSmartAccessGatewayClientUserRequest, runtime: Util.RuntimeOptions): CreateSmartAccessGatewayClientUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.clientIp)) {
    query['ClientIp'] = request.clientIp;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userMail)) {
    query['UserMail'] = request.userMail;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSmartAccessGatewayClientUser',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSmartAccessGatewayClientUser(request: CreateSmartAccessGatewayClientUserRequest): CreateSmartAccessGatewayClientUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSmartAccessGatewayClientUserWithOptions(request, runtime);
}

model CreateSmartAccessGatewaySoftwareRequest {
  autoPay?: boolean(name='AutoPay', example='false'),
  chargeType?: string(name='ChargeType', example='PREPAY'),
  dataPlan?: long(name='DataPlan', example='5'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  period?: int32(name='Period', example='12'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  userCount?: int32(name='UserCount', example='5'),
}

model CreateSmartAccessGatewaySoftwareResponseBody = {
  orderId?: string(name='OrderId', example='203000000000000'),
  requestId?: string(name='RequestId', example='24675405-74DF-4C94-82C6-B749580C498E'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
  smartAGId?: string(name='SmartAGId', example='sag-gnhe6sywtare5******'),
}

model CreateSmartAccessGatewaySoftwareResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateSmartAccessGatewaySoftwareResponseBody(name='body'),
}

async function createSmartAccessGatewaySoftwareWithOptions(request: CreateSmartAccessGatewaySoftwareRequest, runtime: Util.RuntimeOptions): CreateSmartAccessGatewaySoftwareResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.chargeType)) {
    query['ChargeType'] = request.chargeType;
  }
  if (!Util.isUnset(request.dataPlan)) {
    query['DataPlan'] = request.dataPlan;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.period)) {
    query['Period'] = request.period;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.userCount)) {
    query['UserCount'] = request.userCount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateSmartAccessGatewaySoftware',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createSmartAccessGatewaySoftware(request: CreateSmartAccessGatewaySoftwareRequest): CreateSmartAccessGatewaySoftwareResponse {
  var runtime = new Util.RuntimeOptions{};
  return createSmartAccessGatewaySoftwareWithOptions(request, runtime);
}

model DeactiveFlowLogRequest {
  flowLogId?: string(name='FlowLogId', example='fl-l934tsa5504yuc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeactiveFlowLogResponseBody = {
  requestId?: string(name='RequestId', example='5F2BAEAF-96D4-4BE5-A031-6CAD7B145D0D'),
}

model DeactiveFlowLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeactiveFlowLogResponseBody(name='body'),
}

async function deactiveFlowLogWithOptions(request: DeactiveFlowLogRequest, runtime: Util.RuntimeOptions): DeactiveFlowLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeactiveFlowLog',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deactiveFlowLog(request: DeactiveFlowLogRequest): DeactiveFlowLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return deactiveFlowLogWithOptions(request, runtime);
}

model DeleteACLRequest {
  aclId?: string(name='AclId', example='acl-ohlexqptfhy*******'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteACLResponseBody = {
  requestId?: string(name='RequestId', example='00546174-2CE6-4587-9550-04B6A3313938'),
}

model DeleteACLResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteACLResponseBody(name='body'),
}

async function deleteACLWithOptions(request: DeleteACLRequest, runtime: Util.RuntimeOptions): DeleteACLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteACL',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteACL(request: DeleteACLRequest): DeleteACLResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteACLWithOptions(request, runtime);
}

model DeleteACLRuleRequest {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0n*****'),
  acrId?: string(name='AcrId', example='acr-c1hkd054qywiw******'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteACLRuleResponseBody = {
  requestId?: string(name='RequestId', example='39E71162-699A-4E02-AF0F-17621BA6AEF6'),
}

model DeleteACLRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteACLRuleResponseBody(name='body'),
}

async function deleteACLRuleWithOptions(request: DeleteACLRuleRequest, runtime: Util.RuntimeOptions): DeleteACLRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.acrId)) {
    query['AcrId'] = request.acrId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteACLRule',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteACLRule(request: DeleteACLRuleRequest): DeleteACLRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteACLRuleWithOptions(request, runtime);
}

model DeleteCloudConnectNetworkRequest {
  ccnId?: string(name='CcnId', example='ccn-bxuau4ezctts2*****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteCloudConnectNetworkResponseBody = {
  requestId?: string(name='RequestId', example='0BAAF2B9-88B8-4574-BDBE-102A90EE3FEE'),
}

model DeleteCloudConnectNetworkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteCloudConnectNetworkResponseBody(name='body'),
}

async function deleteCloudConnectNetworkWithOptions(request: DeleteCloudConnectNetworkRequest, runtime: Util.RuntimeOptions): DeleteCloudConnectNetworkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnId)) {
    query['CcnId'] = request.ccnId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCloudConnectNetwork',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCloudConnectNetwork(request: DeleteCloudConnectNetworkRequest): DeleteCloudConnectNetworkResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCloudConnectNetworkWithOptions(request, runtime);
}

model DeleteDnatEntryRequest {
  dnatEntryId?: string(name='DnatEntryId', example='fwd-kxe4fq3xuzczze****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sagId?: string(name='SagId', example='sag-jfh***********'),
}

model DeleteDnatEntryResponseBody = {
  requestId?: string(name='RequestId', example='68CE10C0-2EFF-4B82-9907-10AB7E2B0A6C'),
}

model DeleteDnatEntryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteDnatEntryResponseBody(name='body'),
}

async function deleteDnatEntryWithOptions(request: DeleteDnatEntryRequest, runtime: Util.RuntimeOptions): DeleteDnatEntryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dnatEntryId)) {
    query['DnatEntryId'] = request.dnatEntryId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDnatEntry',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteDnatEntry(request: DeleteDnatEntryRequest): DeleteDnatEntryResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDnatEntryWithOptions(request, runtime);
}

model DeleteEnterpriseCodeRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4****'),
  enterpriseCode?: string(name='EnterpriseCode', example='12***'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model DeleteEnterpriseCodeResponseBody = {
  requestId?: string(name='RequestId', example='9DD3DFB2-A9BF-4BEE-9542-661411A9851E'),
}

model DeleteEnterpriseCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteEnterpriseCodeResponseBody(name='body'),
}

async function deleteEnterpriseCodeWithOptions(request: DeleteEnterpriseCodeRequest, runtime: Util.RuntimeOptions): DeleteEnterpriseCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enterpriseCode)) {
    query['EnterpriseCode'] = request.enterpriseCode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEnterpriseCode',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteEnterpriseCode(request: DeleteEnterpriseCodeRequest): DeleteEnterpriseCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteEnterpriseCodeWithOptions(request, runtime);
}

model DeleteFlowLogRequest {
  flowLogId?: string(name='FlowLogId', example='fl-7a56mar1kfw9vj****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteFlowLogResponseBody = {
  requestId?: string(name='RequestId', example='B05AF87C-0FE5-42D7-BEA3-665D90FAA71D'),
}

model DeleteFlowLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteFlowLogResponseBody(name='body'),
}

async function deleteFlowLogWithOptions(request: DeleteFlowLogRequest, runtime: Util.RuntimeOptions): DeleteFlowLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFlowLog',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteFlowLog(request: DeleteFlowLogRequest): DeleteFlowLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFlowLogWithOptions(request, runtime);
}

model DeleteHealthCheckRequest {
  hcInstanceId?: string(name='HcInstanceId', example='hc-vfgyz7dv07lthr****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteHealthCheckResponseBody = {
  requestId?: string(name='RequestId', example='7F0B079C-2D0E-4ABF-A970-C079F785A09C'),
}

model DeleteHealthCheckResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteHealthCheckResponseBody(name='body'),
}

async function deleteHealthCheckWithOptions(request: DeleteHealthCheckRequest, runtime: Util.RuntimeOptions): DeleteHealthCheckResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hcInstanceId)) {
    query['HcInstanceId'] = request.hcInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHealthCheck',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteHealthCheck(request: DeleteHealthCheckRequest): DeleteHealthCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHealthCheckWithOptions(request, runtime);
}

model DeleteProbeTaskRequest {
  probeTaskId?: string(name='ProbeTaskId'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sn?: string(name='Sn'),
}

model DeleteProbeTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteProbeTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteProbeTaskResponseBody(name='body'),
}

async function deleteProbeTaskWithOptions(request: DeleteProbeTaskRequest, runtime: Util.RuntimeOptions): DeleteProbeTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.probeTaskId)) {
    query['ProbeTaskId'] = request.probeTaskId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteProbeTask',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteProbeTask(request: DeleteProbeTaskRequest): DeleteProbeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteProbeTaskWithOptions(request, runtime);
}

model DeleteQosRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosId?: string(name='QosId', example='qos-xhwhyuo43l****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteQosResponseBody = {
  requestId?: string(name='RequestId', example='F77B3F0E-CAA2-41CF-A752-4F2893C5F7F0'),
}

model DeleteQosResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteQosResponseBody(name='body'),
}

async function deleteQosWithOptions(request: DeleteQosRequest, runtime: Util.RuntimeOptions): DeleteQosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteQos',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteQos(request: DeleteQosRequest): DeleteQosResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQosWithOptions(request, runtime);
}

model DeleteQosCarRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosCarId?: string(name='QosCarId', example='qoscar-n5k8g97lihlph****'),
  qosId?: string(name='QosId', example='qos-awfxl1adxeqyk****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteQosCarResponseBody = {
  requestId?: string(name='RequestId', example='551CD836-9E46-4F2C-A167-B4363180A647'),
}

model DeleteQosCarResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteQosCarResponseBody(name='body'),
}

async function deleteQosCarWithOptions(request: DeleteQosCarRequest, runtime: Util.RuntimeOptions): DeleteQosCarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosCarId)) {
    query['QosCarId'] = request.qosCarId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteQosCar',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteQosCar(request: DeleteQosCarRequest): DeleteQosCarResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQosCarWithOptions(request, runtime);
}

model DeleteQosPolicyRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  qosPolicyId?: string(name='QosPolicyId', example='qospy-xhwhyuo43l****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteQosPolicyResponseBody = {
  requestId?: string(name='RequestId', example='551CD836-9E46-4F2C-A167-B4363180A647'),
}

model DeleteQosPolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteQosPolicyResponseBody(name='body'),
}

async function deleteQosPolicyWithOptions(request: DeleteQosPolicyRequest, runtime: Util.RuntimeOptions): DeleteQosPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.qosPolicyId)) {
    query['QosPolicyId'] = request.qosPolicyId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteQosPolicy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteQosPolicy(request: DeleteQosPolicyRequest): DeleteQosPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteQosPolicyWithOptions(request, runtime);
}

model DeleteRouteDistributionStrategyRequest {
  destCidrBlock?: string(name='DestCidrBlock', example='192.XX.XX.0/24'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeSource?: string(name='RouteSource', example='STATIC'),
  smartAGId?: string(name='SmartAGId', example='sag-gyat6giidkvyk****'),
  sourceType?: string(name='SourceType', example='local'),
}

model DeleteRouteDistributionStrategyResponseBody = {
  requestId?: string(name='RequestId', example='BF62139B-D64A-4C95-A55F-6A2335C4417D'),
}

model DeleteRouteDistributionStrategyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteRouteDistributionStrategyResponseBody(name='body'),
}

async function deleteRouteDistributionStrategyWithOptions(request: DeleteRouteDistributionStrategyRequest, runtime: Util.RuntimeOptions): DeleteRouteDistributionStrategyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destCidrBlock)) {
    query['DestCidrBlock'] = request.destCidrBlock;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeSource)) {
    query['RouteSource'] = request.routeSource;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteRouteDistributionStrategy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteRouteDistributionStrategy(request: DeleteRouteDistributionStrategyRequest): DeleteRouteDistributionStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteRouteDistributionStrategyWithOptions(request, runtime);
}

model DeleteSagExpressConnectInterfaceRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='5'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='10'),
}

model DeleteSagExpressConnectInterfaceResponseBody = {
  requestId?: string(name='RequestId', example='AFF7E5A6-6897-4FDC-A5A8-1978B5B3E545'),
}

model DeleteSagExpressConnectInterfaceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSagExpressConnectInterfaceResponseBody(name='body'),
}

async function deleteSagExpressConnectInterfaceWithOptions(request: DeleteSagExpressConnectInterfaceRequest, runtime: Util.RuntimeOptions): DeleteSagExpressConnectInterfaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSagExpressConnectInterface',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSagExpressConnectInterface(request: DeleteSagExpressConnectInterfaceRequest): DeleteSagExpressConnectInterfaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSagExpressConnectInterfaceWithOptions(request, runtime);
}

model DeleteSagStaticRouteRequest {
  destinationCidr?: string(name='DestinationCidr', example='192.XX.XX.0/24'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='0'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='1'),
}

model DeleteSagStaticRouteResponseBody = {
  requestId?: string(name='RequestId', example='A53F71B6-7577-492A-A0CD-C7D3DFFE2D0E'),
}

model DeleteSagStaticRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSagStaticRouteResponseBody(name='body'),
}

async function deleteSagStaticRouteWithOptions(request: DeleteSagStaticRouteRequest, runtime: Util.RuntimeOptions): DeleteSagStaticRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationCidr)) {
    query['DestinationCidr'] = request.destinationCidr;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSagStaticRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSagStaticRoute(request: DeleteSagStaticRouteRequest): DeleteSagStaticRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSagStaticRouteWithOptions(request, runtime);
}

model DeleteServiceAddressRequest {
  address?: string(name='Address'),
  addressType?: string(name='AddressType'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sn?: string(name='Sn'),
}

model DeleteServiceAddressResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DeleteServiceAddressResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteServiceAddressResponseBody(name='body'),
}

async function deleteServiceAddressWithOptions(request: DeleteServiceAddressRequest, runtime: Util.RuntimeOptions): DeleteServiceAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteServiceAddress',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteServiceAddress(request: DeleteServiceAddressRequest): DeleteServiceAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteServiceAddressWithOptions(request, runtime);
}

model DeleteSmartAccessGatewayRequest {
  instanceId?: string(name='InstanceId', example='sag-far8v6owtdxlua****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='E26DBAAE-A796-4A48-98B4-B45AFCD1F299'),
}

model DeleteSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSmartAccessGatewayResponseBody(name='body'),
}

async function deleteSmartAccessGatewayWithOptions(request: DeleteSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): DeleteSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSmartAccessGateway(request: DeleteSmartAccessGatewayRequest): DeleteSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSmartAccessGatewayWithOptions(request, runtime);
}

model DeleteSmartAccessGatewayClientUserRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-kzo5dvms3dqii3****'),
  userName?: string(name='UserName', example='username'),
}

model DeleteSmartAccessGatewayClientUserResponseBody = {
  requestId?: string(name='RequestId', example='09AD82DC-FE26-4B66-B526-2FA6BE82A4D3'),
}

model DeleteSmartAccessGatewayClientUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSmartAccessGatewayClientUserResponseBody(name='body'),
}

async function deleteSmartAccessGatewayClientUserWithOptions(request: DeleteSmartAccessGatewayClientUserRequest, runtime: Util.RuntimeOptions): DeleteSmartAccessGatewayClientUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSmartAccessGatewayClientUser',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSmartAccessGatewayClientUser(request: DeleteSmartAccessGatewayClientUserRequest): DeleteSmartAccessGatewayClientUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSmartAccessGatewayClientUserWithOptions(request, runtime);
}

model DeleteSmartAccessGatewayDnsForwardRequest {
  instanceId?: string(name='InstanceId', example='sagv3dnsforward-nc7qabskj17werc7su'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  sagInsId?: string(name='SagInsId', example='sag-v9un1ccz22owd76lf8'),
  sagSn?: string(name='SagSn', example='sagf4dkqh78'),
}

model DeleteSmartAccessGatewayDnsForwardResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='0BAAF2B9-88B8-4574-BDBE-102A90EE3FEE'),
  success?: string(name='Success', example='true'),
}

model DeleteSmartAccessGatewayDnsForwardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSmartAccessGatewayDnsForwardResponseBody(name='body'),
}

async function deleteSmartAccessGatewayDnsForwardWithOptions(request: DeleteSmartAccessGatewayDnsForwardRequest, runtime: Util.RuntimeOptions): DeleteSmartAccessGatewayDnsForwardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSmartAccessGatewayDnsForward',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSmartAccessGatewayDnsForward(request: DeleteSmartAccessGatewayDnsForwardRequest): DeleteSmartAccessGatewayDnsForwardResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSmartAccessGatewayDnsForwardWithOptions(request, runtime);
}

model DeleteSnatEntryRequest {
  instanceId?: string(name='InstanceId', example='snat-djngdheb*******'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-hfbd*******'),
}

model DeleteSnatEntryResponseBody = {
  requestId?: string(name='RequestId', example='68CE10C0-2EFF-4B82-9907-10AB7E2B0A6C'),
}

model DeleteSnatEntryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteSnatEntryResponseBody(name='body'),
}

async function deleteSnatEntryWithOptions(request: DeleteSnatEntryRequest, runtime: Util.RuntimeOptions): DeleteSnatEntryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSnatEntry',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSnatEntry(request: DeleteSnatEntryRequest): DeleteSnatEntryResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSnatEntryWithOptions(request, runtime);
}

model DescribeACLAttributeRequest {
  aclId?: string(name='AclId', example='acl-ohlexqptfhyaq****'),
  direction?: string(name='Direction', example='out'),
  name?: string(name='Name', example='doctest'),
  order?: string(name='Order', example='1255444444'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeACLAttributeResponseBody = {
  acrs?: {
    acr?: [ 
    {
      aclId?: string(name='AclId', example='acl-7louazbja80bmg****'),
      aclType?: string(name='AclType', example='acl-hardware'),
      acrId?: string(name='AcrId', example='acr-gxzxj5w9qqdf1c****'),
      description?: string(name='Description'),
      destCidr?: string(name='DestCidr', example='0.0.0.0/0'),
      destPortRange?: string(name='DestPortRange', example='10000/20000'),
      direction?: string(name='Direction', example='out'),
      dpiGroupIds?: {
        dpiGroupId?: [ string ](name='DpiGroupId')
      }(name='DpiGroupIds'),
      dpiSignatureIds?: {
        dpiSignatureId?: [ string ](name='DpiSignatureId')
      }(name='DpiSignatureIds'),
      gmtCreate?: long(name='GmtCreate', example='1580821597000'),
      ipProtocol?: string(name='IpProtocol', example='UDP'),
      name?: string(name='Name', example='doctest'),
      policy?: string(name='Policy', example='drop'),
      priority?: int32(name='Priority', example='70'),
      sourceCidr?: string(name='SourceCidr', example='0.0.0.0/0'),
      sourcePortRange?: string(name='SourcePortRange', example='30000/40000'),
      type?: string(name='Type', example='WAN'),
    }
  ](name='Acr')
  }(name='Acrs'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='8F62CE77-FBA2-4F8D-AED9-0A02814EDA69'),
  totalCount?: int32(name='TotalCount', example='3'),
}

model DescribeACLAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeACLAttributeResponseBody(name='body'),
}

async function describeACLAttributeWithOptions(request: DescribeACLAttributeRequest, runtime: Util.RuntimeOptions): DescribeACLAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeACLAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeACLAttribute(request: DescribeACLAttributeRequest): DescribeACLAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeACLAttributeWithOptions(request, runtime);
}

model DescribeACLsRequest {
  aclIds?: string(name='AclIds', example='acl-xhwhyuo43l*******'),
  aclType?: string(name='AclType'),
  name?: string(name='Name', example='test'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeACLsResponseBody = {
  acls?: {
    acl?: [ 
    {
      aclId?: string(name='AclId', example='acl-ohlexqptfhy*******'),
      aclType?: string(name='AclType'),
      name?: string(name='Name', example='test'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
      sagCount?: string(name='SagCount', example='0'),
    }
  ](name='Acl')
  }(name='Acls'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='3'),
  requestId?: string(name='RequestId', example='660F303F-C88E-4026-BC6A-FC24B78FD7EA'),
  totalCount?: int32(name='TotalCount', example='455'),
}

model DescribeACLsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeACLsResponseBody(name='body'),
}

async function describeACLsWithOptions(request: DescribeACLsRequest, runtime: Util.RuntimeOptions): DescribeACLsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!Util.isUnset(request.aclType)) {
    query['AclType'] = request.aclType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeACLs',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeACLs(request: DescribeACLsRequest): DescribeACLsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeACLsWithOptions(request, runtime);
}

model DescribeBindableSmartAccessGatewaysRequest {
  ccnId?: string(name='CcnId', example='ccn-fu75a6m4clv7ai****'),
  crossAccount?: boolean(name='CrossAccount', example='false'),
  name?: string(name='Name', example='sdggd111'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-00uc4vgxch1zsu****'),
}

model DescribeBindableSmartAccessGatewaysResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='9731C2F5-B9A4-42FD-AFD2-361A403E6E85'),
  smartAccessGateways?: {
    smartAccessGateway?: [ 
    {
      name?: string(name='Name', example='sdggd111'),
      smartAGId?: string(name='SmartAGId', example='sag-00uc4vgxch1zsu****'),
      smartAGUid?: long(name='SmartAGUid', example='168840159596****'),
    }
  ](name='SmartAccessGateway')
  }(name='SmartAccessGateways'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model DescribeBindableSmartAccessGatewaysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeBindableSmartAccessGatewaysResponseBody(name='body'),
}

async function describeBindableSmartAccessGatewaysWithOptions(request: DescribeBindableSmartAccessGatewaysRequest, runtime: Util.RuntimeOptions): DescribeBindableSmartAccessGatewaysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnId)) {
    query['CcnId'] = request.ccnId;
  }
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBindableSmartAccessGateways',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeBindableSmartAccessGateways(request: DescribeBindableSmartAccessGatewaysRequest): DescribeBindableSmartAccessGatewaysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBindableSmartAccessGatewaysWithOptions(request, runtime);
}

model DescribeClientUserDNSRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-9uyg53s6juhpxv****'),
}

model DescribeClientUserDNSResponseBody = {
  appDNS?: [ string ](name='AppDNS'),
  recoveredDNS?: [ string ](name='RecoveredDNS'),
  requestId?: string(name='RequestId', example='894AA8BD-0627-45B1-AA18-9CE1D50DA9D0'),
}

model DescribeClientUserDNSResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeClientUserDNSResponseBody(name='body'),
}

async function describeClientUserDNSWithOptions(request: DescribeClientUserDNSRequest, runtime: Util.RuntimeOptions): DescribeClientUserDNSResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeClientUserDNS',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeClientUserDNS(request: DescribeClientUserDNSRequest): DescribeClientUserDNSResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClientUserDNSWithOptions(request, runtime);
}

model DescribeCloudConnectNetworksRequest {
  ccnId?: string(name='CcnId', example='ccn-l9340rlu5enst*****'),
  name?: string(name='Name', example='ccnname'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key', example='test'),
      value?: string(name='Value', example='test'),
    }
  ](name='Tag'),
}

model DescribeCloudConnectNetworksResponseBody = {
  cloudConnectNetworks?: {
    cloudConnectNetwork?: [ 
    {
      associatedCenId?: string(name='AssociatedCenId', example='cen-0jtu0bcbika5b5****'),
      associatedCenOwnerId?: string(name='AssociatedCenOwnerId', example='168800000000****'),
      associatedCloudBoxCount?: string(name='AssociatedCloudBoxCount', example='1'),
      availableCloudBoxCount?: string(name='AvailableCloudBoxCount', example='1'),
      ccnId?: string(name='CcnId', example='ccn-l9340rlu5enst******'),
      cidrBlock?: string(name='CidrBlock', example='10.10.10.0/24'),
      createTime?: long(name='CreateTime', example='1523618639000'),
      description?: string(name='Description', example='ccndesc'),
      interworkingStatus?: string(name='InterworkingStatus', example='enable'),
      name?: string(name='Name', example='ccnname'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
      snatCidrBlock?: string(name='SnatCidrBlock', example='10.10.10.0/25'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key', example='test'),
          value?: string(name='Value', example='test'),
        }
      ](name='Tag')
      }(name='Tags'),
    }
  ](name='CloudConnectNetwork')
  }(name='CloudConnectNetworks'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='3F2A0B80-D6D1-4764-8D77-38067DBBA345'),
  totalCount?: int32(name='TotalCount', example='3'),
}

model DescribeCloudConnectNetworksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeCloudConnectNetworksResponseBody(name='body'),
}

async function describeCloudConnectNetworksWithOptions(request: DescribeCloudConnectNetworksRequest, runtime: Util.RuntimeOptions): DescribeCloudConnectNetworksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnId)) {
    query['CcnId'] = request.ccnId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCloudConnectNetworks',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCloudConnectNetworks(request: DescribeCloudConnectNetworksRequest): DescribeCloudConnectNetworksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeCloudConnectNetworksWithOptions(request, runtime);
}

model DescribeDeviceAutoUpgradePolicyRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sage62x022502****'),
  smartAGId?: string(name='SmartAGId', example='sag-kxe2cv7hot7qrv****'),
  versionType?: string(name='VersionType', example='Device'),
}

model DescribeDeviceAutoUpgradePolicyResponseBody = {
  cronExpression?: string(name='CronExpression', example='0 0 4 1/1 * ?'),
  duration?: string(name='Duration', example='60'),
  jitter?: string(name='Jitter', example='5'),
  requestId?: string(name='RequestId', example='0E20FBB8-BCFC-4F5E-BD94-77FF6A2133D0'),
  serialNumber?: string(name='SerialNumber', example='sage62x022502****'),
  smartAGId?: string(name='SmartAGId', example='sag-kxe2cv7hot7qrv****'),
  timeZone?: string(name='TimeZone', example='Asia/Shanghai'),
  upgradeType?: string(name='UpgradeType', example='scheduled'),
}

model DescribeDeviceAutoUpgradePolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDeviceAutoUpgradePolicyResponseBody(name='body'),
}

async function describeDeviceAutoUpgradePolicyWithOptions(request: DescribeDeviceAutoUpgradePolicyRequest, runtime: Util.RuntimeOptions): DescribeDeviceAutoUpgradePolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.versionType)) {
    query['VersionType'] = request.versionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDeviceAutoUpgradePolicy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDeviceAutoUpgradePolicy(request: DescribeDeviceAutoUpgradePolicyRequest): DescribeDeviceAutoUpgradePolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDeviceAutoUpgradePolicyWithOptions(request, runtime);
}

model DescribeDnatEntriesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='12'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sagId?: string(name='SagId', example='sag-djgd*************'),
  type?: string(name='Type', example='Intranet'),
}

model DescribeDnatEntriesResponseBody = {
  dnatEntries?: {
    dnatEntry?: [ 
    {
      dnatEntryId?: string(name='DnatEntryId', example='fwd-kxe4fq3xuzczze****'),
      externalIp?: string(name='ExternalIp', example='10.10.**.**'),
      externalPort?: string(name='ExternalPort', example='12'),
      internalIp?: string(name='InternalIp', example='192.168.0.1'),
      internalPort?: string(name='InternalPort', example='80'),
      ipProtocol?: string(name='IpProtocol', example='tcp'),
      sagId?: string(name='SagId', example='sag-jfh********'),
      type?: string(name='Type', example='Intranet'),
    }
  ](name='DnatEntry')
  }(name='DnatEntries'),
  pageNumber?: int32(name='PageNumber', example='12'),
  pageSize?: int32(name='PageSize', example='1'),
  requestId?: string(name='RequestId', example='635640CA-2335-4856-A9CB-1CB5C444DC5A'),
  totalCount?: int32(name='TotalCount', example='50'),
}

model DescribeDnatEntriesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeDnatEntriesResponseBody(name='body'),
}

async function describeDnatEntriesWithOptions(request: DescribeDnatEntriesRequest, runtime: Util.RuntimeOptions): DescribeDnatEntriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDnatEntries',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDnatEntries(request: DescribeDnatEntriesRequest): DescribeDnatEntriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDnatEntriesWithOptions(request, runtime);
}

model DescribeFlowLogSagsRequest {
  flowLogId?: string(name='FlowLogId', example='fl-l934tsa5504yuc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghahi'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeFlowLogSagsResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='4'),
  requestId?: string(name='RequestId', example='8D945945-85F2-4BD7-A144-7DC0E8B5A0DC'),
  sags?: {
    sag?: [ 
    {
      description?: string(name='Description', example='sag-100wm'),
      name?: string(name='Name', example='ruijie-test-2'),
      smartAGId?: string(name='SmartAGId', example='sag-6rm1awijm3ktic****'),
    }
  ](name='Sag')
  }(name='Sags'),
  totalCount?: int32(name='TotalCount', example='35'),
}

model DescribeFlowLogSagsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeFlowLogSagsResponseBody(name='body'),
}

async function describeFlowLogSagsWithOptions(request: DescribeFlowLogSagsRequest, runtime: Util.RuntimeOptions): DescribeFlowLogSagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeFlowLogSags',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeFlowLogSags(request: DescribeFlowLogSagsRequest): DescribeFlowLogSagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFlowLogSagsWithOptions(request, runtime);
}

model DescribeFlowLogsRequest {
  description?: string(name='Description', example='desc'),
  flowLogId?: string(name='FlowLogId', example='fl-7a56mar1kfw9vj****'),
  flowLogName?: string(name='FlowLogName', example='DDE'),
  outputType?: string(name='OutputType', example='all'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: string(name='Status', example='Active'),
}

model DescribeFlowLogsResponseBody = {
  flowLogs?: {
    flowLogSetType?: [ 
    {
      activeAging?: int32(name='ActiveAging', example='300'),
      description?: string(name='Description', example='aaa'),
      flowLogId?: string(name='FlowLogId', example='fl-7a56mar1kfw9vj****'),
      inactiveAging?: int32(name='InactiveAging', example='15'),
      logstoreName?: string(name='LogstoreName', example='config-operation-log'),
      name?: string(name='Name', example='DDE'),
      netflowServerIp?: string(name='NetflowServerIp', example='192.168.0.1'),
      netflowServerPort?: string(name='NetflowServerPort', example='9995'),
      netflowVersion?: string(name='NetflowVersion', example='V9'),
      outputType?: string(name='OutputType', example='sls'),
      projectName?: string(name='ProjectName', example='sag-flowlog-shanghai'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
      slsRegionId?: string(name='SlsRegionId', example='cn-shanghai'),
      status?: string(name='Status', example='Active'),
      totalSagNum?: int32(name='TotalSagNum', example='2'),
    }
  ](name='FlowLogSetType')
  }(name='FlowLogs'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='44F4E2D0-77F7-4DEC-969B-061688946143'),
  totalCount?: int32(name='TotalCount', example='5'),
}

model DescribeFlowLogsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeFlowLogsResponseBody(name='body'),
}

async function describeFlowLogsWithOptions(request: DescribeFlowLogsRequest, runtime: Util.RuntimeOptions): DescribeFlowLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.flowLogName)) {
    query['FlowLogName'] = request.flowLogName;
  }
  if (!Util.isUnset(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeFlowLogs',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeFlowLogs(request: DescribeFlowLogsRequest): DescribeFlowLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeFlowLogsWithOptions(request, runtime);
}

model DescribeGrantRulesRequest {
  associatedCcnId?: string(name='AssociatedCcnId', example='ccn-n2935s1mnwv8i*****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeGrantRulesResponseBody = {
  grantRules?: {
    grantRule?: [ 
    {
      ccnInstanceId?: string(name='CcnInstanceId', example='ccn-n2935s1mnwv8i*****'),
      ccnUid?: long(name='CcnUid', example='1220123456123456'),
      cenInstanceId?: string(name='CenInstanceId', example='cen-0jtu0bcbika5b5****'),
      cenUid?: long(name='CenUid', example='1250123456123456'),
      gmtCreate?: long(name='GmtCreate', example='1563439920000'),
      gmtModified?: long(name='GmtModified', example='1563439920000'),
      grantRuleId?: string(name='GrantRuleId', example='18313265-d988-406c-965d-3e110ff*****'),
      grantTrafficService?: boolean(name='GrantTrafficService', example='false'),
      regionId?: string(name='RegionId', example='cn-shanghai'),
    }
  ](name='GrantRule')
  }(name='GrantRules'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='FA579C2D-84A0-4BA1-B9C3-1E5A3B15F1B6'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeGrantRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeGrantRulesResponseBody(name='body'),
}

async function describeGrantRulesWithOptions(request: DescribeGrantRulesRequest, runtime: Util.RuntimeOptions): DescribeGrantRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.associatedCcnId)) {
    query['AssociatedCcnId'] = request.associatedCcnId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGrantRules',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeGrantRules(request: DescribeGrantRulesRequest): DescribeGrantRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGrantRulesWithOptions(request, runtime);
}

model DescribeGrantSagRulesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-hdg*************'),
}

model DescribeGrantSagRulesResponseBody = {
  grantRules?: {
    grantRule?: [ 
    {
      ccnInstanceId?: string(name='CcnInstanceId', example='ccn-hd**********'),
      ccnUid?: long(name='CcnUid', example='123456'),
      createTime?: long(name='CreateTime', example='156576751700'),
      grantTrafficService?: boolean(name='GrantTrafficService', example='false'),
      instanceId?: string(name='InstanceId', example='123455'),
      smartAGId?: string(name='SmartAGId', example='sag-hdhgn*****'),
    }
  ](name='GrantRule')
  }(name='GrantRules'),
  pageNumber?: int32(name='PageNumber', example='2'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='6E1674AC-083C-4031-B047-7A66E418E0C6'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model DescribeGrantSagRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeGrantSagRulesResponseBody(name='body'),
}

async function describeGrantSagRulesWithOptions(request: DescribeGrantSagRulesRequest, runtime: Util.RuntimeOptions): DescribeGrantSagRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGrantSagRules',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeGrantSagRules(request: DescribeGrantSagRulesRequest): DescribeGrantSagRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGrantSagRulesWithOptions(request, runtime);
}

model DescribeGrantSagVbrRulesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-0nnteglltw6z4b****'),
  vbrInstanceId?: string(name='VbrInstanceId', example='vbr-bp13gtbhdp0pfqg6s****'),
}

model DescribeGrantSagVbrRulesResponseBody = {
  grantRules?: {
    grantRule?: [ 
    {
      bound?: boolean(name='Bound', example='false'),
      createTime?: long(name='CreateTime', example='1600743723000'),
      instanceId?: string(name='InstanceId', example='sgv-3x8djyem7vqh70****'),
      smartAGId?: string(name='SmartAGId', example='sag-0nnteglltw6z4b****'),
      smartAGUid?: long(name='SmartAGUid', example='1231571212121212'),
      vbrInstanceId?: string(name='VbrInstanceId', example='vbr-bp13gtbhdp0pfqg6s****'),
      vbrRegionId?: string(name='VbrRegionId', example='cn-hangzhou'),
      vbrUid?: long(name='VbrUid', example='1231571212121212'),
    }
  ](name='GrantRule')
  }(name='GrantRules'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='46E98E69-FBA2-423E-9E5A-A3C6D843FED1'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeGrantSagVbrRulesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeGrantSagVbrRulesResponseBody(name='body'),
}

async function describeGrantSagVbrRulesWithOptions(request: DescribeGrantSagVbrRulesRequest, runtime: Util.RuntimeOptions): DescribeGrantSagVbrRulesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.vbrInstanceId)) {
    query['VbrInstanceId'] = request.vbrInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeGrantSagVbrRules',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeGrantSagVbrRules(request: DescribeGrantSagVbrRulesRequest): DescribeGrantSagVbrRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeGrantSagVbrRulesWithOptions(request, runtime);
}

model DescribeHealthCheckAttributeRequest {
  hcInstanceId?: string(name='HcInstanceId', example='hc-1k4ucuq77b56x4****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
}

model DescribeHealthCheckAttributeResponseBody = {
  createTime?: long(name='CreateTime', example='1586759657000'),
  description?: string(name='Description', example='hc-123'),
  dstIpAddr?: string(name='DstIpAddr', example='192.XX.XX.1'),
  dstPort?: int32(name='DstPort', example='1223'),
  failCountThreshold?: int32(name='FailCountThreshold', example='3'),
  hcInstanceId?: string(name='HcInstanceId', example='hc-1k4ucuq77b56x4****'),
  name?: string(name='Name', example='bvt-test-03****'),
  probeCount?: int32(name='ProbeCount', example='3'),
  probeInterval?: int32(name='ProbeInterval', example='2000'),
  probeTimeout?: int32(name='ProbeTimeout', example='1000'),
  requestId?: string(name='RequestId', example='DDA08B78-5634-4A83-94E4-5C58FD7EBA19'),
  rttFailThreshold?: int32(name='RttFailThreshold', example='3'),
  rttThreshold?: int32(name='RttThreshold', example='300'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
  srcIpAddr?: string(name='SrcIpAddr', example='10.XX.XX.1'),
  srcPort?: int32(name='SrcPort', example='2334'),
  type?: string(name='Type', example='ICMP_ECHO'),
}

model DescribeHealthCheckAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeHealthCheckAttributeResponseBody(name='body'),
}

async function describeHealthCheckAttributeWithOptions(request: DescribeHealthCheckAttributeRequest, runtime: Util.RuntimeOptions): DescribeHealthCheckAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hcInstanceId)) {
    query['HcInstanceId'] = request.hcInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHealthCheckAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHealthCheckAttribute(request: DescribeHealthCheckAttributeRequest): DescribeHealthCheckAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHealthCheckAttributeWithOptions(request, runtime);
}

model DescribeHealthChecksRequest {
  hcInstanceId?: string(name='HcInstanceId', example='hc-ifflm5ygj3diwiu****'),
  name?: string(name='Name', example='ddd3333'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-qi0p07ld5q86k3****'),
}

model DescribeHealthChecksResponseBody = {
  healthChecks?: {
    healthCheck?: [ 
    {
      description?: string(name='Description'),
      dstIpAddr?: string(name='DstIpAddr', example='110.XX.XX.1'),
      dstPort?: int32(name='DstPort', example='33'),
      failCountThreshold?: int32(name='FailCountThreshold', example='3'),
      hcInstanceId?: string(name='HcInstanceId', example='hc-ifflm5ygj3diwi****'),
      name?: string(name='Name', example='doctest'),
      probeCount?: int32(name='ProbeCount', example='2'),
      probeInterval?: int32(name='ProbeInterval', example='2000'),
      probeTimeout?: int32(name='ProbeTimeout', example='1000'),
      relationCount?: int32(name='RelationCount', example='3'),
      rttFailThreshold?: int32(name='RttFailThreshold', example='3'),
      rttThreshold?: int32(name='RttThreshold', example='45'),
      smartAGId?: string(name='SmartAGId', example='sag-qi0p07ld5q86k3****'),
      srcIpAddr?: string(name='SrcIpAddr', example='192.XX.XX.1'),
      srcPort?: int32(name='SrcPort', example='334'),
      status?: string(name='Status', example='unknown'),
      type?: string(name='Type', example='ICMP_ECHO'),
    }
  ](name='HealthCheck')
  }(name='HealthChecks'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='0B275FE6-FC86-4921-BC70-1B3DF68B078F'),
  totalCount?: int32(name='TotalCount', example='5'),
}

model DescribeHealthChecksResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeHealthChecksResponseBody(name='body'),
}

async function describeHealthChecksWithOptions(request: DescribeHealthChecksRequest, runtime: Util.RuntimeOptions): DescribeHealthChecksResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.hcInstanceId)) {
    query['HcInstanceId'] = request.hcInstanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHealthChecks',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeHealthChecks(request: DescribeHealthChecksRequest): DescribeHealthChecksResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHealthChecksWithOptions(request, runtime);
}

model DescribeQosCarsRequest {
  description?: string(name='Description', example='testdesc'),
  order?: string(name='Order', example='asc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  qosCarId?: string(name='QosCarId', example='qoscar-n5k8g97lihlph****'),
  qosId?: string(name='QosId', example='qos-awfxl1adxeqyk****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeQosCarsResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  qosCars?: {
    qosCar?: [ 
    {
      description?: string(name='Description', example='des'),
      limitType?: string(name='LimitType', example='Absolute'),
      maxBandwidthAbs?: int32(name='MaxBandwidthAbs', example='6'),
      maxBandwidthPercent?: int32(name='MaxBandwidthPercent', example='90'),
      minBandwidthAbs?: int32(name='MinBandwidthAbs', example='2'),
      minBandwidthPercent?: int32(name='MinBandwidthPercent', example='20'),
      name?: string(name='Name', example='name'),
      percentSourceType?: string(name='PercentSourceType', example='CcnBandwidth'),
      priority?: int32(name='Priority', example='3'),
      qosCarId?: string(name='QosCarId', example='qos-awfxl1adxeqyk****'),
      qosId?: string(name='QosId', example='qos-awfxl1adxeqyk****'),
    }
  ](name='QosCar')
  }(name='QosCars'),
  requestId?: string(name='RequestId', example='B7B758A9-009E-4C9D-9618-714EAE8BA5E9'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model DescribeQosCarsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeQosCarsResponseBody(name='body'),
}

async function describeQosCarsWithOptions(request: DescribeQosCarsRequest, runtime: Util.RuntimeOptions): DescribeQosCarsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.qosCarId)) {
    query['QosCarId'] = request.qosCarId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeQosCars',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeQosCars(request: DescribeQosCarsRequest): DescribeQosCarsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeQosCarsWithOptions(request, runtime);
}

model DescribeQosPoliciesRequest {
  description?: string(name='Description', example='docdesc'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  priority?: int32(name='Priority', example='1'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  qosPolicyId?: string(name='QosPolicyId', example='qospy-427m9fo6wkh****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeQosPoliciesResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  qosPolicies?: {
    qosPolicy?: [ 
    {
      description?: string(name='Description', example='docdesc'),
      destCidr?: string(name='DestCidr', example='10.10.10.0/24'),
      destPortRange?: string(name='DestPortRange', example='90/90'),
      dpiGroupIds?: {
        dpiGroupId?: [ string ](name='DpiGroupId')
      }(name='DpiGroupIds'),
      dpiSignatureIds?: {
        dpiSignatureId?: [ string ](name='DpiSignatureId')
      }(name='DpiSignatureIds'),
      endTime?: string(name='EndTime', example='2019-07-14T16:41:33+0800'),
      ipProtocol?: string(name='IpProtocol', example='TCP'),
      name?: string(name='Name', example='test'),
      priority?: int32(name='Priority', example='1'),
      qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
      qosPolicyId?: string(name='QosPolicyId', example='qospy-427m9fo6wkh****'),
      sourceCidr?: string(name='SourceCidr', example='10.0.0.0/24'),
      sourcePortRange?: string(name='SourcePortRange', example='80/80'),
      startTime?: string(name='StartTime', example='2019-07-14T16:41:33+0800'),
    }
  ](name='QosPolicy')
  }(name='QosPolicies'),
  requestId?: string(name='RequestId', example='97862812-2C7E-4D25-B0D5-B26DAC7FA293'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model DescribeQosPoliciesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeQosPoliciesResponseBody(name='body'),
}

async function describeQosPoliciesWithOptions(request: DescribeQosPoliciesRequest, runtime: Util.RuntimeOptions): DescribeQosPoliciesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.qosPolicyId)) {
    query['QosPolicyId'] = request.qosPolicyId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeQosPolicies',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeQosPolicies(request: DescribeQosPoliciesRequest): DescribeQosPoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeQosPoliciesWithOptions(request, runtime);
}

model DescribeQosesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  qosIds?: string(name='QosIds', example='qos-oek3r2cmvk7m8q****'),
  qosName?: string(name='QosName', example='zxtest'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeQosesResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  qoses?: {
    qos?: [ 
    {
      qosDescription?: string(name='QosDescription', example='description'),
      qosId?: string(name='QosId', example='qos-oek3r2cmvk7m8q****'),
      qosName?: string(name='QosName', example='zxtest'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
      sagCount?: string(name='SagCount', example='0'),
      smartAGIds?: string(name='SmartAGIds', example='sag-x34wj76fe0vhw*****,sag-jp04l844chg16*****'),
    }
  ](name='Qos')
  }(name='Qoses'),
  requestId?: string(name='RequestId', example='2B5F35DD-0D66-41FC-AA99-BAE473E1A7A2'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeQosesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeQosesResponseBody(name='body'),
}

async function describeQosesWithOptions(request: DescribeQosesRequest, runtime: Util.RuntimeOptions): DescribeQosesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.qosIds)) {
    query['QosIds'] = request.qosIds;
  }
  if (!Util.isUnset(request.qosName)) {
    query['QosName'] = request.qosName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeQoses',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeQoses(request: DescribeQosesRequest): DescribeQosesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeQosesWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', example='zh-CN'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      localName?: string(name='LocalName'),
      regionEndpoint?: string(name='RegionEndpoint', example='smartag.cn-shanghai.aliyuncs.com'),
      regionId?: string(name='RegionId', example='cn-shanghai'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId', example='2F026E79-30AD-47B6-9E7D-D1D4BA77F1F1'),
}

model DescribeRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRegionsResponseBody(name='body'),
}

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeRouteDistributionStrategiesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-erx3qta5xg5zyq****'),
  sourceType?: string(name='SourceType', example='cloud'),
}

model DescribeRouteDistributionStrategiesResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='944C2533-1BB7-4578-B6EB-DA05BB61C02A'),
  strategies?: {
    strategy?: [ 
    {
      conflictInfo?: string(name='ConflictInfo', example='"10.90.6.0/24":"vbr-wz900pom71qyr6x67qz65,vbr-wz9f8icxnlcom7riz0gfx"'),
      createTime?: long(name='CreateTime', example='1622617250000'),
      destCidrBlock?: string(name='DestCidrBlock', example='192.168.3.0/24'),
      hcInstanceId?: string(name='HcInstanceId', example='hc-sztovuprqzgm50****'),
      isConflict?: boolean(name='IsConflict', example='false'),
      routeDistribution?: string(name='RouteDistribution', example='publish'),
      routeSource?: string(name='RouteSource', example='STATIC'),
      smartAGId?: string(name='SmartAGId', example='sag-erx3qta5xg5zyq****'),
      sourceType?: string(name='SourceType', example='cloud'),
      status?: string(name='Status', example='normal'),
      strategyPublishStatus?: string(name='StrategyPublishStatus', example='publish'),
    }
  ](name='Strategy')
  }(name='Strategies'),
  totalCount?: int32(name='TotalCount', example='5'),
}

model DescribeRouteDistributionStrategiesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeRouteDistributionStrategiesResponseBody(name='body'),
}

async function describeRouteDistributionStrategiesWithOptions(request: DescribeRouteDistributionStrategiesRequest, runtime: Util.RuntimeOptions): DescribeRouteDistributionStrategiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRouteDistributionStrategies',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRouteDistributionStrategies(request: DescribeRouteDistributionStrategiesRequest): DescribeRouteDistributionStrategiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRouteDistributionStrategiesWithOptions(request, runtime);
}

model DescribeSAGDeviceInfoRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-7f3d9b6jwnuqn6****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSAGDeviceInfoResponseBody = {
  controllerState?: string(name='ControllerState', example='Normal'),
  lastConnectedControllerTime?: string(name='LastConnectedControllerTime', example='2021-07-14 00:27:48'),
  requestId?: string(name='RequestId', example='B6A991F4-F533-1627-8144-B64E01C5EE85'),
  resettableStatus?: string(name='ResettableStatus', example='Enabled'),
  serviceIP?: string(name='ServiceIP', example='42.XX.XX.151'),
  smartAGType?: string(name='SmartAGType', example='sag-100wm'),
  startupTime?: string(name='StartupTime', example='2021-06-15 17:33:43'),
  synStatus?: string(name='SynStatus', example='Unsynchronized'),
  version?: string(name='Version', example='2.3.1.1'),
  vpnState?: string(name='VpnState', example='Abnormal'),
}

model DescribeSAGDeviceInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSAGDeviceInfoResponseBody(name='body'),
}

async function describeSAGDeviceInfoWithOptions(request: DescribeSAGDeviceInfoRequest, runtime: Util.RuntimeOptions): DescribeSAGDeviceInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSAGDeviceInfo',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSAGDeviceInfo(request: DescribeSAGDeviceInfoRequest): DescribeSAGDeviceInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSAGDeviceInfoWithOptions(request, runtime);
}

model DescribeSagCurrentDnsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagCurrentDnsResponseBody = {
  masterDns?: string(name='MasterDns', example='223.XX.XX.5'),
  requestId?: string(name='RequestId', example='0937DEA0-AB4B-42F4-9314-07B97D30282B'),
  slaveDns?: string(name='SlaveDns', example='114.XX.XX.114'),
}

model DescribeSagCurrentDnsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagCurrentDnsResponseBody(name='body'),
}

async function describeSagCurrentDnsWithOptions(request: DescribeSagCurrentDnsRequest, runtime: Util.RuntimeOptions): DescribeSagCurrentDnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagCurrentDns',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagCurrentDns(request: DescribeSagCurrentDnsRequest): DescribeSagCurrentDnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagCurrentDnsWithOptions(request, runtime);
}

model DescribeSagDropTopNRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  size?: int32(name='Size', example='10'),
}

model DescribeSagDropTopNResponseBody = {
  dropTopN?: [ 
    {
      dropRate?: string(name='DropRate', example='0.0'),
      instanceId?: string(name='InstanceId', example='sag-whfn****'),
      name?: string(name='Name', example='test'),
      regionId?: string(name='RegionId', example='cn-shanghai'),
    }
  ](name='DropTopN'),
  requestId?: string(name='RequestId', example='AFF7E5A6-6897-4FDC-A5A8-1978B5B3E545'),
}

model DescribeSagDropTopNResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagDropTopNResponseBody(name='body'),
}

async function describeSagDropTopNWithOptions(request: DescribeSagDropTopNRequest, runtime: Util.RuntimeOptions): DescribeSagDropTopNResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagDropTopN',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagDropTopN(request: DescribeSagDropTopNRequest): DescribeSagDropTopNResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagDropTopNWithOptions(request, runtime);
}

model DescribeSagExpressConnectInterfaceListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='3'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagExpressConnectInterfaceListResponseBody = {
  interfaces?: [ 
    {
      IP?: string(name='IP', example='192.XX.XX.1'),
      mask?: string(name='Mask', example='255.255.255.0'),
      vlan?: string(name='Vlan', example='2'),
    }
  ](name='Interfaces'),
  requestId?: string(name='RequestId', example='2718F7A6-EA67-41EF-BA39-E9F4A0F5D306'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586835287000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagExpressConnectInterfaceListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagExpressConnectInterfaceListResponseBody(name='body'),
}

async function describeSagExpressConnectInterfaceListWithOptions(request: DescribeSagExpressConnectInterfaceListRequest, runtime: Util.RuntimeOptions): DescribeSagExpressConnectInterfaceListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagExpressConnectInterfaceList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagExpressConnectInterfaceList(request: DescribeSagExpressConnectInterfaceListRequest): DescribeSagExpressConnectInterfaceListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagExpressConnectInterfaceListWithOptions(request, runtime);
}

model DescribeSagGlobalRouteProtocolRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagGlobalRouteProtocolResponseBody = {
  requestId?: string(name='RequestId', example='3712F0B2-721E-4FBF-BBEF-888E3BFE0A20'),
  routeProtocol?: string(name='RouteProtocol', example='STATIC'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586855592000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagGlobalRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagGlobalRouteProtocolResponseBody(name='body'),
}

async function describeSagGlobalRouteProtocolWithOptions(request: DescribeSagGlobalRouteProtocolRequest, runtime: Util.RuntimeOptions): DescribeSagGlobalRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagGlobalRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagGlobalRouteProtocol(request: DescribeSagGlobalRouteProtocolRequest): DescribeSagGlobalRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagGlobalRouteProtocolWithOptions(request, runtime);
}

model DescribeSagHaRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagHaResponseBody = {
  mode?: string(name='Mode', example='NONE'),
  ports?: [ 
    {
      portName?: string(name='PortName', example='5'),
      virtualIp?: string(name='VirtualIp', example='192.XX.XX.1'),
    }
  ](name='Ports'),
  requestId?: string(name='RequestId', example='273D62FD-E346-4959-AA18-D79B9276FEFB'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586836343000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagHaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagHaResponseBody(name='body'),
}

async function describeSagHaWithOptions(request: DescribeSagHaRequest, runtime: Util.RuntimeOptions): DescribeSagHaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagHa',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagHa(request: DescribeSagHaRequest): DescribeSagHaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagHaWithOptions(request, runtime);
}

model DescribeSagLanListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagLanListResponseBody = {
  lans?: [ 
    {
      endIp?: string(name='EndIp', example='192.XX.XX.254'),
      IP?: string(name='IP', example='192.XX.XX.1'),
      IPType?: string(name='IPType', example='DHCP'),
      lease?: string(name='Lease', example='7'),
      mask?: string(name='Mask', example='255.255.255.0'),
      portName?: string(name='PortName', example='0'),
      startIp?: string(name='StartIp', example='192.XX.XX.2'),
    }
  ](name='Lans'),
  requestId?: string(name='RequestId', example='1120228A-E5E1-4E9C-B56D-96887E1A2B2F'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586852928000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagLanListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagLanListResponseBody(name='body'),
}

async function describeSagLanListWithOptions(request: DescribeSagLanListRequest, runtime: Util.RuntimeOptions): DescribeSagLanListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagLanList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagLanList(request: DescribeSagLanListRequest): DescribeSagLanListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagLanListWithOptions(request, runtime);
}

model DescribeSagManagementPortRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-jbauqzw5ildnud****'),
  smartAGSn?: string(name='SmartAGSn', example='sage62x021922****'),
}

model DescribeSagManagementPortResponseBody = {
  gateway?: string(name='Gateway', example='192.XX.XX.254'),
  IP?: string(name='IP', example='192.XX.XX.10'),
  mask?: string(name='Mask', example='255.255.255.0'),
  requestId?: string(name='RequestId', example='3616AAA9-3A6F-4604-98AF-86753AB7F040'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586759657000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagManagementPortResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagManagementPortResponseBody(name='body'),
}

async function describeSagManagementPortWithOptions(request: DescribeSagManagementPortRequest, runtime: Util.RuntimeOptions): DescribeSagManagementPortResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagManagementPort',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagManagementPort(request: DescribeSagManagementPortRequest): DescribeSagManagementPortResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagManagementPortWithOptions(request, runtime);
}

model DescribeSagOnlineClientStatisticsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGIds?: [ string ](name='SmartAGIds', example='sag-va03wf4l4idaj*****'),
}

model DescribeSagOnlineClientStatisticsResponseBody = {
  requestId?: string(name='RequestId', example='9EC839B6-0EA5-4F19-A4B7-A9E465D057AE'),
  sagStatistics?: {
    statistics?: [ 
    {
      onlineCount?: string(name='OnlineCount', example='0'),
      smartAGId?: string(name='SmartAGId', example='sag-va03wf4l4idaj*****'),
    }
  ](name='Statistics')
  }(name='SagStatistics'),
}

model DescribeSagOnlineClientStatisticsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagOnlineClientStatisticsResponseBody(name='body'),
}

async function describeSagOnlineClientStatisticsWithOptions(request: DescribeSagOnlineClientStatisticsRequest, runtime: Util.RuntimeOptions): DescribeSagOnlineClientStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGIds)) {
    query['SmartAGIds'] = request.smartAGIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagOnlineClientStatistics',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagOnlineClientStatistics(request: DescribeSagOnlineClientStatisticsRequest): DescribeSagOnlineClientStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagOnlineClientStatisticsWithOptions(request, runtime);
}

model DescribeSagPortListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagPortListResponseBody = {
  ports?: [ 
    {
      mac?: string(name='Mac', example='c4:00:ad:a2:f5:****'),
      portName?: string(name='PortName', example='5'),
      role?: string(name='Role', example='NONE'),
      status?: string(name='Status', example='Down'),
    }
  ](name='Ports'),
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586762479000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagPortListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagPortListResponseBody(name='body'),
}

async function describeSagPortListWithOptions(request: DescribeSagPortListRequest, runtime: Util.RuntimeOptions): DescribeSagPortListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagPortList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagPortList(request: DescribeSagPortListRequest): DescribeSagPortListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagPortListWithOptions(request, runtime);
}

model DescribeSagPortRouteProtocolListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagPortRouteProtocolListResponseBody = {
  ports?: [ 
    {
      neighborIp?: string(name='NeighborIp', example='192.XX.XX.1'),
      portName?: string(name='PortName', example='3'),
      remoteAs?: string(name='RemoteAs', example='12345'),
      remoteIp?: string(name='RemoteIp', example='192.XX.XX.1'),
      routeProtocol?: string(name='RouteProtocol', example='BGP'),
      status?: string(name='Status', example='UP'),
      vlan?: string(name='Vlan', example='2'),
    }
  ](name='Ports'),
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586843621000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagPortRouteProtocolListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagPortRouteProtocolListResponseBody(name='body'),
}

async function describeSagPortRouteProtocolListWithOptions(request: DescribeSagPortRouteProtocolListRequest, runtime: Util.RuntimeOptions): DescribeSagPortRouteProtocolListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagPortRouteProtocolList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagPortRouteProtocolList(request: DescribeSagPortRouteProtocolListRequest): DescribeSagPortRouteProtocolListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagPortRouteProtocolListWithOptions(request, runtime);
}

model DescribeSagRemoteAccessRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sage62x022502****'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
}

model DescribeSagRemoteAccessResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='successful'),
  remoteAccesses?: {
    remoteAccess?: [ 
    {
      remoteAccessIp?: string(name='RemoteAccessIp', example='192.XX.XX.1'),
      serialNumber?: string(name='SerialNumber', example='sage62x022502****'),
    }
  ](name='RemoteAccess')
  }(name='RemoteAccesses'),
  requestId?: string(name='RequestId', example='E38E950D-28A4-4C41-9428-A8908EC6AE5C'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
  success?: boolean(name='Success', example='true'),
}

model DescribeSagRemoteAccessResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagRemoteAccessResponseBody(name='body'),
}

async function describeSagRemoteAccessWithOptions(request: DescribeSagRemoteAccessRequest, runtime: Util.RuntimeOptions): DescribeSagRemoteAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagRemoteAccess',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagRemoteAccess(request: DescribeSagRemoteAccessRequest): DescribeSagRemoteAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagRemoteAccessWithOptions(request, runtime);
}

model DescribeSagRouteListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagRouteListResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  routes?: [ 
    {
      conflictCidrs?: [ string ](name='ConflictCidrs'),
      cost?: string(name='Cost', example='[110/11]'),
      destinationCidr?: string(name='DestinationCidr', example='6.XX.XX.6/32'),
      nextHop?: string(name='NextHop', example='192.XX.XX.1'),
      portName?: string(name='PortName', example='2'),
      routeProtocol?: string(name='RouteProtocol', example='STATIC'),
    }
  ](name='Routes'),
}

model DescribeSagRouteListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagRouteListResponseBody(name='body'),
}

async function describeSagRouteListWithOptions(request: DescribeSagRouteListRequest, runtime: Util.RuntimeOptions): DescribeSagRouteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagRouteList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagRouteList(request: DescribeSagRouteListRequest): DescribeSagRouteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagRouteListWithOptions(request, runtime);
}

model DescribeSagRouteProtocolBgpRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagRouteProtocolBgpResponseBody = {
  holdTime?: int32(name='HoldTime', example='9'),
  keepAlive?: int32(name='KeepAlive', example='3'),
  localAs?: int32(name='LocalAs', example='65536'),
  requestId?: string(name='RequestId', example='2F39E4FE-B45C-47FF-9921-95780486F52D'),
  routerId?: string(name='RouterId', example='192.XX.XX.1'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586765938000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagRouteProtocolBgpResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagRouteProtocolBgpResponseBody(name='body'),
}

async function describeSagRouteProtocolBgpWithOptions(request: DescribeSagRouteProtocolBgpRequest, runtime: Util.RuntimeOptions): DescribeSagRouteProtocolBgpResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagRouteProtocolBgp',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagRouteProtocolBgp(request: DescribeSagRouteProtocolBgpRequest): DescribeSagRouteProtocolBgpResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagRouteProtocolBgpWithOptions(request, runtime);
}

model DescribeSagRouteProtocolOspfRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagRouteProtocolOspfResponseBody = {
  areaId?: string(name='AreaId', example='10'),
  areaType?: string(name='AreaType', example='NSSA'),
  authenticationType?: string(name='AuthenticationType', example='MD5'),
  deadTime?: int32(name='DeadTime', example='40'),
  helloTime?: int32(name='HelloTime', example='10'),
  md5Key?: string(name='Md5Key', example='123****'),
  md5KeyId?: int32(name='Md5KeyId', example='1'),
  requestId?: string(name='RequestId', example='60F9B653-25B7-4511-A3C7-BCBAF462393E'),
  routerId?: string(name='RouterId', example='1.XX.XX.1'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586843621000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagRouteProtocolOspfResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagRouteProtocolOspfResponseBody(name='body'),
}

async function describeSagRouteProtocolOspfWithOptions(request: DescribeSagRouteProtocolOspfRequest, runtime: Util.RuntimeOptions): DescribeSagRouteProtocolOspfResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagRouteProtocolOspf',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagRouteProtocolOspf(request: DescribeSagRouteProtocolOspfRequest): DescribeSagRouteProtocolOspfResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagRouteProtocolOspfWithOptions(request, runtime);
}

model DescribeSagStaticRouteListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagStaticRouteListResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  staticRoutes?: [ 
    {
      destinationCidr?: string(name='DestinationCidr', example='192.XX.XX.0/24'),
      nextHop?: string(name='NextHop', example='192.XX.XX.1'),
      portName?: string(name='PortName', example='0'),
      vlan?: string(name='Vlan', example='1'),
    }
  ](name='StaticRoutes'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586857309000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagStaticRouteListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagStaticRouteListResponseBody(name='body'),
}

async function describeSagStaticRouteListWithOptions(request: DescribeSagStaticRouteListRequest, runtime: Util.RuntimeOptions): DescribeSagStaticRouteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagStaticRouteList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagStaticRouteList(request: DescribeSagStaticRouteListRequest): DescribeSagStaticRouteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagStaticRouteListWithOptions(request, runtime);
}

model DescribeSagTrafficTopNRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  size?: int32(name='Size', example='10'),
}

model DescribeSagTrafficTopNResponseBody = {
  requestId?: string(name='RequestId', example='AFF7E5A6-6897-4FDC-A5A8-1978B5B3E545'),
  trafficTopN?: [ 
    {
      instanceId?: string(name='InstanceId', example='sag-whfn****'),
      name?: string(name='Name', example='test'),
      regionId?: string(name='RegionId', example='cn-shanghai'),
      trafficRate?: string(name='TrafficRate', example='3866.6666666666665'),
    }
  ](name='TrafficTopN'),
}

model DescribeSagTrafficTopNResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagTrafficTopNResponseBody(name='body'),
}

async function describeSagTrafficTopNWithOptions(request: DescribeSagTrafficTopNRequest, runtime: Util.RuntimeOptions): DescribeSagTrafficTopNResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.size)) {
    query['Size'] = request.size;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagTrafficTopN',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagTrafficTopN(request: DescribeSagTrafficTopNRequest): DescribeSagTrafficTopNResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagTrafficTopNWithOptions(request, runtime);
}

model DescribeSagUserDnsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagUserDnsResponseBody = {
  masterDns?: string(name='MasterDns', example='192.XX.XX.1'),
  requestId?: string(name='RequestId', example='0937DEA0-AB4B-42F4-9314-07B97D30282B'),
  slaveDns?: string(name='SlaveDns', example='192.XX.XX.2'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586852928000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagUserDnsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagUserDnsResponseBody(name='body'),
}

async function describeSagUserDnsWithOptions(request: DescribeSagUserDnsRequest, runtime: Util.RuntimeOptions): DescribeSagUserDnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagUserDns',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagUserDns(request: DescribeSagUserDnsRequest): DescribeSagUserDnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagUserDnsWithOptions(request, runtime);
}

model DescribeSagVbrRelationsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  vbrInstanceIds?: [ string ](name='VbrInstanceIds', example='vbr-bp15ihkk93ezxppkd****'),
  vbrRegionId?: string(name='VbrRegionId', example='cn-hangzhou'),
}

model DescribeSagVbrRelationsResponseBody = {
  requestId?: string(name='RequestId', example='17D79124-104A-42DB-8FCA-CE2957CD1723'),
  sagVbrRelations?: [ 
    {
      sagInstanceId?: string(name='SagInstanceId', example='sag-0nnteglltw6z4b****'),
      sagUid?: string(name='SagUid', example='16884015121212****'),
      vbrInstanceId?: string(name='VbrInstanceId', example='vbr-bp15ihkk93ezxppk****'),
    }
  ](name='SagVbrRelations'),
}

model DescribeSagVbrRelationsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagVbrRelationsResponseBody(name='body'),
}

async function describeSagVbrRelationsWithOptions(request: DescribeSagVbrRelationsRequest, runtime: Util.RuntimeOptions): DescribeSagVbrRelationsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.vbrInstanceIds)) {
    query['VbrInstanceIds'] = request.vbrInstanceIds;
  }
  if (!Util.isUnset(request.vbrRegionId)) {
    query['VbrRegionId'] = request.vbrRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagVbrRelations',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagVbrRelations(request: DescribeSagVbrRelationsRequest): DescribeSagVbrRelationsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagVbrRelationsWithOptions(request, runtime);
}

model DescribeSagWan4GRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagWan4GResponseBody = {
  ip?: string(name='Ip', example='192.XX.XX.1'),
  mac?: string(name='Mac', example='c4:00:ad:a2:f5:****'),
  priority?: int32(name='Priority', example='99'),
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  status?: string(name='Status', example='Normal'),
  strength?: string(name='Strength', example='High'),
  trafficState?: string(name='TrafficState', example='active'),
}

model DescribeSagWan4GResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagWan4GResponseBody(name='body'),
}

async function describeSagWan4GWithOptions(request: DescribeSagWan4GRequest, runtime: Util.RuntimeOptions): DescribeSagWan4GResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagWan4G',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagWan4G(request: DescribeSagWan4GRequest): DescribeSagWan4GResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagWan4GWithOptions(request, runtime);
}

model DescribeSagWanListRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagWanListResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586834861000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
  wans?: [ 
    {
      bandWidth?: int32(name='BandWidth', example='50'),
      gateway?: string(name='Gateway', example='192.XX.XX.1'),
      IP?: string(name='IP', example='172.XX.XX.1'),
      IPType?: string(name='IPType', example='STATIC'),
      ISP?: string(name='ISP', example='CT'),
      mask?: string(name='Mask', example='255.255.255.240'),
      portName?: string(name='PortName', example='1'),
      priority?: int32(name='Priority', example='1'),
      trafficState?: string(name='TrafficState', example='active'),
      username?: string(name='Username', example='Usernamexx'),
      weight?: int32(name='Weight', example='100'),
    }
  ](name='Wans'),
}

model DescribeSagWanListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagWanListResponseBody(name='body'),
}

async function describeSagWanListWithOptions(request: DescribeSagWanListRequest, runtime: Util.RuntimeOptions): DescribeSagWanListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagWanList',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagWanList(request: DescribeSagWanListRequest): DescribeSagWanListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagWanListWithOptions(request, runtime);
}

model DescribeSagWanSnatRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagWanSnatResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
  snat?: string(name='Snat', example='ENABLE'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586847787000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagWanSnatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagWanSnatResponseBody(name='body'),
}

async function describeSagWanSnatWithOptions(request: DescribeSagWanSnatRequest, runtime: Util.RuntimeOptions): DescribeSagWanSnatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagWanSnat',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagWanSnat(request: DescribeSagWanSnatRequest): DescribeSagWanSnatResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagWanSnatWithOptions(request, runtime);
}

model DescribeSagWifiRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model DescribeSagWifiResponseBody = {
  authenticationType?: string(name='AuthenticationType', example='WPA2-PSK'),
  bandwidth?: string(name='Bandwidth'),
  channel?: string(name='Channel', example='0'),
  encryptAlgorithm?: string(name='EncryptAlgorithm', example='AES'),
  isAuth?: string(name='IsAuth', example='True'),
  isBroadcast?: string(name='IsBroadcast', example='True'),
  isEnable?: string(name='IsEnable', example='True'),
  requestId?: string(name='RequestId', example='E93884AC-6C21-4FEA-8E3A-7377D33B194F'),
  ssid?: string(name='Ssid', example='aliyun_sag_123456***'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime', example='1586843621000'),
      errorCode?: string(name='ErrorCode', example='200'),
      errorMessage?: string(name='ErrorMessage', example='Successful'),
      state?: string(name='State', example='Succeed'),
    }
  ](name='TaskStates'),
}

model DescribeSagWifiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSagWifiResponseBody(name='body'),
}

async function describeSagWifiWithOptions(request: DescribeSagWifiRequest, runtime: Util.RuntimeOptions): DescribeSagWifiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSagWifi',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSagWifi(request: DescribeSagWifiRequest): DescribeSagWifiResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSagWifiWithOptions(request, runtime);
}

model DescribeSmartAccessGatewayAttributeRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-6z21oj0vjjrx****'),
}

model DescribeSmartAccessGatewayAttributeResponseBody = {
  accelerateBandwidth?: long(name='AccelerateBandwidth', example='1'),
  accessPointId?: string(name='AccessPointId', example='238'),
  aclIds?: {
    aclId?: [ string ](name='AclId')
  }(name='AclIds'),
  applicationBandwidthPackageBussinessStatus?: string(name='ApplicationBandwidthPackageBussinessStatus', example='Normal'),
  applicationBandwidthPackageId?: string(name='ApplicationBandwidthPackageId', example='abwp-7963l7iqnquyj3****'),
  applicationBandwidthPackageName?: string(name='ApplicationBandwidthPackageName', example='testname'),
  applicationBandwidthPackageOperationLocks?: {
    lockReason?: string(name='LockReason', example='Message'),
    lockType?: string(name='LockType', example='FinancialLocked'),
  }(name='ApplicationBandwidthPackageOperationLocks'),
  associatedCcnId?: string(name='AssociatedCcnId', example='ccn-iz26o9zye6lhoo****'),
  associatedCcnName?: string(name='AssociatedCcnName', example='testname'),
  backupBoxControllerIp?: string(name='BackupBoxControllerIp', example='112.XX.XX.27'),
  boxControllerIp?: string(name='BoxControllerIp', example='112.XX.XX.25'),
  cidrBlock?: string(name='CidrBlock', example='10.0.9.0/24'),
  city?: string(name='City', example='cn-shanghai'),
  createTime?: long(name='CreateTime', example='1622617250000'),
  dataPlan?: long(name='DataPlan', example='5'),
  description?: string(name='Description', example='testdesc'),
  devices?: {
    device?: [ 
    {
      distributeSkStatus?: int32(name='DistributeSkStatus', example='1'),
      dpiSignatureDbVersion?: string(name='DpiSignatureDbVersion', example='20201117_1_0-0.0.1'),
      haState?: string(name='HaState', example='Active'),
      hcState?: string(name='HcState', example='online'),
      monitorVersion?: string(name='MonitorVersion', example='0.1.11.17'),
      secretKey?: string(name='SecretKey', example='+T4nV8xkS4****'),
      serialNumber?: string(name='SerialNumber', example='sage6gsdllbid****"'),
      softwareVersion?: string(name='SoftwareVersion', example='2.3.0.0'),
    }
  ](name='Device')
  }(name='Devices'),
  enableOptimization?: boolean(name='EnableOptimization', example='false'),
  enableSoftwareConnectionAudit?: boolean(name='EnableSoftwareConnectionAudit', example='true'),
  endTime?: long(name='EndTime', example='1628265600000'),
  flowLogIds?: {
    flowLogId?: [ string ](name='FlowLogId')
  }(name='FlowLogIds'),
  IRIds?: {
    IRId?: [ string ](name='IRId')
  }(name='IRIds'),
  instanceType?: string(name='InstanceType', example='sag-vcpe'),
  ipsecStatus?: string(name='IpsecStatus', example='up'),
  links?: {
    link?: [ 
    {
      bandwidth?: string(name='Bandwidth', example='50 M'),
      commodityType?: string(name='CommodityType', example='smartag'),
      endTime?: long(name='EndTime', example='1628265600000'),
      healthCheckTargetIp?: string(name='HealthCheckTargetIp', example='100.XX.XX.144'),
      instanceId?: string(name='InstanceId', example='sag-6z21oj0vjjrx****'),
      relateInstanceId?: string(name='RelateInstanceId', example='ccn-iz26o9zye6lho****'),
      relateInstanceRegionId?: string(name='RelateInstanceRegionId', example='cn-shanghai'),
      status?: string(name='Status', example='Active'),
      type?: string(name='Type', example='ccn'),
    }
  ](name='Link')
  }(name='Links'),
  maxBandwidth?: string(name='MaxBandwidth', example='50 M'),
  name?: string(name='Name', example='testname'),
  optimizationType?: boolean(name='OptimizationType', example='fec'),
  position?: string(name='Position'),
  qosIds?: {
    qosId?: [ string ](name='QosId')
  }(name='QosIds'),
  requestId?: string(name='RequestId', example='F02D092B-A0B7-4BA1-BCA7-014B953C5DC7'),
  resellerInstanceId?: string(name='ResellerInstanceId', example='sag-v0fkpk4akfz5******'),
  resellerUid?: string(name='ResellerUid', example='1688121212121212'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
  routingStrategy?: string(name='RoutingStrategy', example='static'),
  securityLockThreshold?: int32(name='SecurityLockThreshold', example='3600'),
  serialNumber?: string(name='SerialNumber', example='sage6gsdllbidl****,sage6nniq3d****'),
  smartAGId?: string(name='SmartAGId', example='sag-6z21oj0vjjrx6s****'),
  status?: string(name='Status', example='Active'),
  trafficMasterSn?: string(name='TrafficMasterSn', example='sage6nniq3d****'),
  upBandwidth4G?: int32(name='UpBandwidth4G', example='3'),
  upBandwidthWan?: int32(name='UpBandwidthWan', example='4'),
  userCount?: int32(name='UserCount', example='3'),
  vpnStatus?: string(name='VpnStatus', example='down'),
}

model DescribeSmartAccessGatewayAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSmartAccessGatewayAttributeResponseBody(name='body'),
}

async function describeSmartAccessGatewayAttributeWithOptions(request: DescribeSmartAccessGatewayAttributeRequest, runtime: Util.RuntimeOptions): DescribeSmartAccessGatewayAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSmartAccessGatewayAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSmartAccessGatewayAttribute(request: DescribeSmartAccessGatewayAttributeRequest): DescribeSmartAccessGatewayAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSmartAccessGatewayAttributeWithOptions(request, runtime);
}

model DescribeSmartAccessGatewayClientUsersRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-kzo5dvms3dqii3*****'),
  userMail?: string(name='UserMail', example='username@example.com'),
  userName?: string(name='UserName', example='username'),
}

model DescribeSmartAccessGatewayClientUsersResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='62F4CF10-F909-487E-8E95-BC35457C5F50'),
  totalCount?: int32(name='TotalCount', example='1'),
  users?: {
    user?: [ 
    {
      accelerateBandwidth?: long(name='AccelerateBandwidth', example='1000'),
      bandwidth?: int32(name='Bandwidth', example='2000'),
      clientIp?: string(name='ClientIp', example='10.10.10.1'),
      isStaticIp?: long(name='IsStaticIp', example='0'),
      state?: int32(name='State', example='1'),
      userMail?: string(name='UserMail', example='username@example.com'),
      userName?: string(name='UserName', example='username'),
    }
  ](name='User')
  }(name='Users'),
}

model DescribeSmartAccessGatewayClientUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSmartAccessGatewayClientUsersResponseBody(name='body'),
}

async function describeSmartAccessGatewayClientUsersWithOptions(request: DescribeSmartAccessGatewayClientUsersRequest, runtime: Util.RuntimeOptions): DescribeSmartAccessGatewayClientUsersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userMail)) {
    query['UserMail'] = request.userMail;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSmartAccessGatewayClientUsers',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSmartAccessGatewayClientUsers(request: DescribeSmartAccessGatewayClientUsersRequest): DescribeSmartAccessGatewayClientUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSmartAccessGatewayClientUsersWithOptions(request, runtime);
}

model DescribeSmartAccessGatewayHaRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-pno62188piyc6txxxxx'),
}

model DescribeSmartAccessGatewayHaResponseBody = {
  backupDeviceId?: string(name='BackupDeviceId', example='sag11axxxx'),
  deviceLevelBackupState?: string(name='DeviceLevelBackupState', example='OFF'),
  deviceLevelBackupType?: string(name='DeviceLevelBackupType', example='cold_backup'),
  linkBackupInfoList?: {
    linkBackupInfoList?: [ 
    {
      backupLinkId?: string(name='BackupLinkId', example='wan1'),
      backupLinkState?: string(name='BackupLinkState', example='down'),
      linkLevelBackupState?: string(name='LinkLevelBackupState', example='ON'),
      linkLevelBackupType?: string(name='LinkLevelBackupType', example='StandbyMode'),
      mainLinkId?: string(name='MainLinkId', example='lte'),
      mainLinkState?: string(name='MainLinkState', example='up'),
    }
  ](name='LinkBackupInfoList')
  }(name='LinkBackupInfoList'),
  mainDeviceId?: string(name='MainDeviceId', example='sag11axxxx'),
  requestId?: string(name='RequestId', example='582FE511-FEFE-42BC-BBF4-4F8ECF92Exxx'),
  smartAGId?: string(name='SmartAGId', example='sag-i8mogwi9kisigc3xxxx'),
}

model DescribeSmartAccessGatewayHaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSmartAccessGatewayHaResponseBody(name='body'),
}

async function describeSmartAccessGatewayHaWithOptions(request: DescribeSmartAccessGatewayHaRequest, runtime: Util.RuntimeOptions): DescribeSmartAccessGatewayHaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSmartAccessGatewayHa',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSmartAccessGatewayHa(request: DescribeSmartAccessGatewayHaRequest): DescribeSmartAccessGatewayHaResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSmartAccessGatewayHaWithOptions(request, runtime);
}

model DescribeSmartAccessGatewayVersionsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-d3m51apgw4po5*****'),
  smartAGSn?: string(name='SmartAGSn', example='sage62x022502****'),
  versionType?: string(name='VersionType', example='Device'),
}

model DescribeSmartAccessGatewayVersionsResponseBody = {
  requestId?: string(name='RequestId', example='765AB188-69BF-47C6-BEDD-B9FC72BFBB0'),
  smartAGVersions?: {
    smartAGVersion?: [ 
    {
      createTime?: long(name='CreateTime', example='1522744623000'),
      type?: string(name='Type', example='release'),
      versionCode?: string(name='VersionCode', example='1.0'),
      versionName?: string(name='VersionName', example='testpackage1'),
    }
  ](name='SmartAGVersion')
  }(name='SmartAGVersions'),
}

model DescribeSmartAccessGatewayVersionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSmartAccessGatewayVersionsResponseBody(name='body'),
}

async function describeSmartAccessGatewayVersionsWithOptions(request: DescribeSmartAccessGatewayVersionsRequest, runtime: Util.RuntimeOptions): DescribeSmartAccessGatewayVersionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.versionType)) {
    query['VersionType'] = request.versionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSmartAccessGatewayVersions',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSmartAccessGatewayVersions(request: DescribeSmartAccessGatewayVersionsRequest): DescribeSmartAccessGatewayVersionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSmartAccessGatewayVersionsWithOptions(request, runtime);
}

model DescribeSmartAccessGatewaysRequest {
  aclIds?: string(name='AclIds', example='acl-xhwhyuo43l0n****'),
  associatedCcnId?: string(name='AssociatedCcnId', example='ccn-bxuau4ezctt****'),
  associatedCcnName?: string(name='AssociatedCcnName', example='ccn'),
  businessState?: string(name='BusinessState', example='Normal'),
  canAssociateQos?: boolean(name='CanAssociateQos', example='false'),
  hardwareType?: string(name='HardwareType', example='sag-100wm'),
  instanceType?: string(name='InstanceType', example='hardware'),
  name?: string(name='Name', example='nametest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sag32a3****'),
  smartAGId?: string(name='SmartAGId', example='sag-6z21oj0vjjrx6s****'),
  smartAGIds?: [ string ](name='SmartAGIds'),
  softwareVersion?: string(name='SoftwareVersion', example='2.3.0.0'),
  status?: string(name='Status', example='Active'),
  unboundAclIds?: string(name='UnboundAclIds', example='acl-sjfbgngj****'),
  versionComparator?: string(name='VersionComparator', example='equals'),
}

model DescribeSmartAccessGatewaysResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='ADE68CEE-8E4F-4D0B-9EE9-2C2FFAABF41F'),
  smartAccessGateways?: {
    smartAccessGateway?: [ 
    {
      accelerateBandwidth?: long(name='AccelerateBandwidth', example='1'),
      accessPointId?: string(name='AccessPointId', example='238'),
      aclIds?: string(name='AclIds', example='acl-shfhfhhfbnvkdg****'),
      applicationBandwidthPackageId?: string(name='ApplicationBandwidthPackageId', example='abwp-7963l7iqnquyj3****'),
      associatedCcnId?: string(name='AssociatedCcnId', example='ccn-iz26o9zye6lhoo****'),
      associatedCcnName?: string(name='AssociatedCcnName', example='ccn'),
      backupSoftwareVersion?: string(name='BackupSoftwareVersion', example='2.3.0.0'),
      backupStatus?: string(name='BackupStatus', example='Active'),
      cidrBlock?: string(name='CidrBlock', example='10.0.9.0/24'),
      city?: string(name='City', example='cn-shanghai'),
      createTime?: long(name='CreateTime', example='1622617250000'),
      dataPlan?: long(name='DataPlan', example='5'),
      description?: string(name='Description', example='docdesc'),
      dpiMonitorStatus?: string(name='DpiMonitorStatus', example='Inactive'),
      dpiStatus?: string(name='DpiStatus', example='Off'),
      enableAdvancedMonitor?: boolean(name='EnableAdvancedMonitor'),
      enableSoftwareConnectionAudit?: boolean(name='EnableSoftwareConnectionAudit', example='true'),
      endTime?: long(name='EndTime', example='1628265600000'),
      enterpriseCode?: string(name='EnterpriseCode', example='12P****'),
      hardwareVersion?: string(name='HardwareVersion', example='sag-100wm'),
      IRIds?: string(name='IRIds'),
      idaasApplicationId?: string(name='IdaasApplicationId', example='idaas-cn-hangzhou-l7j0wf0crzea****'),
      idaasId?: string(name='IdaasId', example='idaas-cn-hangzhou-1ahixtl****'),
      ipsecStatus?: string(name='IpsecStatus', example='up'),
      isp?: string(name='Isp'),
      links?: {
        link?: [ 
        {
          bandwidth?: string(name='Bandwidth', example='50M'),
          commodityType?: string(name='CommodityType', example='smartag'),
          endTime?: long(name='EndTime', example='1628265600000'),
          instanceId?: string(name='InstanceId', example='sag-6z21oj0vjjrx6s****'),
          relateInstanceId?: string(name='RelateInstanceId', example='ccn-iz26o9zye6lhoo****'),
          relateInstanceRegionId?: string(name='RelateInstanceRegionId', example='cn-shanghai'),
          status?: string(name='Status', example='Active'),
          type?: string(name='Type', example='ccn'),
        }
      ](name='Link')
      }(name='Links'),
      maxBandwidth?: string(name='MaxBandwidth', example='50M'),
      name?: string(name='Name', example='testname'),
      position?: string(name='Position'),
      qosIds?: string(name='QosIds', example='qos-djh****'),
      resellerInstanceId?: string(name='ResellerInstanceId', example='sag-v0fkpk4akfz5****'),
      resellerUid?: string(name='ResellerUid', example='25346073170691****'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm2iu4fnc****'),
      routingStrategy?: string(name='RoutingStrategy', example='static'),
      securityLockThreshold?: int32(name='SecurityLockThreshold', example='3600'),
      serialNumber?: string(name='SerialNumber', example='sage6gsdllbid****,sage6nniq3dqa****'),
      smartAGId?: string(name='SmartAGId', example='sag-6z21oj0vjjrx6s****'),
      smartAGUid?: long(name='SmartAGUid', example='1210123456123456'),
      softwareVersion?: string(name='SoftwareVersion', example='2.3.0.0'),
      status?: string(name='Status', example='Active'),
      upBandwidth4G?: int32(name='UpBandwidth4G', example='3'),
      upBandwidthWan?: int32(name='UpBandwidthWan', example='2'),
      userCount?: int32(name='UserCount', example='3'),
      vpnStatus?: string(name='VpnStatus', example='down'),
    }
  ](name='SmartAccessGateway')
  }(name='SmartAccessGateways'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeSmartAccessGatewaysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSmartAccessGatewaysResponseBody(name='body'),
}

async function describeSmartAccessGatewaysWithOptions(request: DescribeSmartAccessGatewaysRequest, runtime: Util.RuntimeOptions): DescribeSmartAccessGatewaysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclIds)) {
    query['AclIds'] = request.aclIds;
  }
  if (!Util.isUnset(request.associatedCcnId)) {
    query['AssociatedCcnId'] = request.associatedCcnId;
  }
  if (!Util.isUnset(request.associatedCcnName)) {
    query['AssociatedCcnName'] = request.associatedCcnName;
  }
  if (!Util.isUnset(request.businessState)) {
    query['BusinessState'] = request.businessState;
  }
  if (!Util.isUnset(request.canAssociateQos)) {
    query['CanAssociateQos'] = request.canAssociateQos;
  }
  if (!Util.isUnset(request.hardwareType)) {
    query['HardwareType'] = request.hardwareType;
  }
  if (!Util.isUnset(request.instanceType)) {
    query['InstanceType'] = request.instanceType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGIds)) {
    query['SmartAGIds'] = request.smartAGIds;
  }
  if (!Util.isUnset(request.softwareVersion)) {
    query['SoftwareVersion'] = request.softwareVersion;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.unboundAclIds)) {
    query['UnboundAclIds'] = request.unboundAclIds;
  }
  if (!Util.isUnset(request.versionComparator)) {
    query['VersionComparator'] = request.versionComparator;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSmartAccessGateways',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSmartAccessGateways(request: DescribeSmartAccessGatewaysRequest): DescribeSmartAccessGatewaysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSmartAccessGatewaysWithOptions(request, runtime);
}

model DescribeSnatEntriesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='2'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn************'),
}

model DescribeSnatEntriesResponseBody = {
  pageNumber?: int32(name='PageNumber', example='12'),
  pageSize?: int32(name='PageSize', example='5'),
  requestId?: string(name='RequestId', example='674BC3B2-5828-41D5-830E-148EE6CF86C2'),
  snatEntries?: {
    snatEntry?: [ 
    {
      cidrBlock?: string(name='CidrBlock', example='192.169.10.0/24'),
      createTime?: long(name='CreateTime', example='1523604565000'),
      instanceId?: string(name='InstanceId', example='snat-sl7kb9cpgfds*****'),
      snatIp?: string(name='SnatIp', example='10.10.**.**'),
    }
  ](name='SnatEntry')
  }(name='SnatEntries'),
  totalCount?: int32(name='TotalCount', example='12'),
}

model DescribeSnatEntriesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeSnatEntriesResponseBody(name='body'),
}

async function describeSnatEntriesWithOptions(request: DescribeSnatEntriesRequest, runtime: Util.RuntimeOptions): DescribeSnatEntriesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSnatEntries',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSnatEntries(request: DescribeSnatEntriesRequest): DescribeSnatEntriesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSnatEntriesWithOptions(request, runtime);
}

model DescribeUnbindFlowLogSagsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeUnbindFlowLogSagsResponseBody = {
  count?: int32(name='Count', example='20'),
  requestId?: string(name='RequestId', example='C850C10E-9856-45FF-8640-80288BA467DF'),
  sags?: {
    sag?: [ 
    {
      description?: string(name='Description', example='desctest'),
      name?: string(name='Name', example='sj1000-yf-01'),
      smartAGId?: string(name='SmartAGId', example='sag-tzirqx07bvcngm****'),
    }
  ](name='Sag')
  }(name='Sags'),
}

model DescribeUnbindFlowLogSagsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeUnbindFlowLogSagsResponseBody(name='body'),
}

async function describeUnbindFlowLogSagsWithOptions(request: DescribeUnbindFlowLogSagsRequest, runtime: Util.RuntimeOptions): DescribeUnbindFlowLogSagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUnbindFlowLogSags',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeUnbindFlowLogSags(request: DescribeUnbindFlowLogSagsRequest): DescribeUnbindFlowLogSagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUnbindFlowLogSagsWithOptions(request, runtime);
}

model DescribeUserFlowStatisticsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-mfkg*****'),
  statisticsDate?: string(name='StatisticsDate', example='201905'),
  userNames?: [ string ](name='UserNames', example='12'),
}

model DescribeUserFlowStatisticsResponseBody = {
  requestId?: string(name='RequestId', example='9552AD68-18EA-4074-B27D-40040FBA9683'),
  sagStatistics?: {
    statistics?: [ 
    {
      totalBytes?: string(name='TotalBytes', example='12'),
      userName?: string(name='UserName', example='doctest'),
    }
  ](name='Statistics')
  }(name='SagStatistics'),
}

model DescribeUserFlowStatisticsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeUserFlowStatisticsResponseBody(name='body'),
}

async function describeUserFlowStatisticsWithOptions(request: DescribeUserFlowStatisticsRequest, runtime: Util.RuntimeOptions): DescribeUserFlowStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.statisticsDate)) {
    query['StatisticsDate'] = request.statisticsDate;
  }
  if (!Util.isUnset(request.userNames)) {
    query['UserNames'] = request.userNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserFlowStatistics',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeUserFlowStatistics(request: DescribeUserFlowStatisticsRequest): DescribeUserFlowStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserFlowStatisticsWithOptions(request, runtime);
}

model DescribeUserOnlineClientStatisticsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-sfjg*****'),
  userNames?: [ string ](name='UserNames', example='doctest'),
}

model DescribeUserOnlineClientStatisticsResponseBody = {
  requestId?: string(name='RequestId', example='14846A6A-2192-4F6A-B272-B8BD68EBC89B'),
  userStatistics?: {
    statistics?: [ 
    {
      onlineCount?: string(name='OnlineCount', example='2'),
      userName?: string(name='UserName', example='doctest'),
    }
  ](name='Statistics')
  }(name='UserStatistics'),
}

model DescribeUserOnlineClientStatisticsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeUserOnlineClientStatisticsResponseBody(name='body'),
}

async function describeUserOnlineClientStatisticsWithOptions(request: DescribeUserOnlineClientStatisticsRequest, runtime: Util.RuntimeOptions): DescribeUserOnlineClientStatisticsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userNames)) {
    query['UserNames'] = request.userNames;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserOnlineClientStatistics',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeUserOnlineClientStatistics(request: DescribeUserOnlineClientStatisticsRequest): DescribeUserOnlineClientStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserOnlineClientStatisticsWithOptions(request, runtime);
}

model DescribeUserOnlineClientsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-wfjgn**********'),
  userName?: string(name='UserName', example='doctest'),
}

model DescribeUserOnlineClientsResponseBody = {
  requestId?: string(name='RequestId', example='7108A98F-C47D-45F7-A4D8-C2E3022735DA'),
  users?: {
    user?: [ 
    {
      clientIp?: string(name='ClientIp', example='10.**.**.**'),
      onlineTime?: string(name='OnlineTime', example='1559125519'),
    }
  ](name='User')
  }(name='Users'),
}

model DescribeUserOnlineClientsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeUserOnlineClientsResponseBody(name='body'),
}

async function describeUserOnlineClientsWithOptions(request: DescribeUserOnlineClientsRequest, runtime: Util.RuntimeOptions): DescribeUserOnlineClientsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserOnlineClients',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeUserOnlineClients(request: DescribeUserOnlineClientsRequest): DescribeUserOnlineClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserOnlineClientsWithOptions(request, runtime);
}

model DiagnoseSmartAccessGatewayRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
  smartAGSn?: string(name='SmartAGSn', example='sage62x022502****'),
}

model DiagnoseSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='193AE392-76C2-4D3E-9420-889A51B43CC0'),
}

model DiagnoseSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DiagnoseSmartAccessGatewayResponseBody(name='body'),
}

async function diagnoseSmartAccessGatewayWithOptions(request: DiagnoseSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): DiagnoseSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DiagnoseSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function diagnoseSmartAccessGateway(request: DiagnoseSmartAccessGatewayRequest): DiagnoseSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return diagnoseSmartAccessGatewayWithOptions(request, runtime);
}

model DisableSmartAGDpiMonitorRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4-130****'),
  dryRun?: boolean(name='DryRun', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-vwmylqc9521p5l****'),
}

model DisableSmartAGDpiMonitorResponseBody = {
  requestId?: string(name='RequestId', example='64966488-B3E3-41E2-9570-4596117EC12E'),
}

model DisableSmartAGDpiMonitorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableSmartAGDpiMonitorResponseBody(name='body'),
}

async function disableSmartAGDpiMonitorWithOptions(request: DisableSmartAGDpiMonitorRequest, runtime: Util.RuntimeOptions): DisableSmartAGDpiMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableSmartAGDpiMonitor',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableSmartAGDpiMonitor(request: DisableSmartAGDpiMonitorRequest): DisableSmartAGDpiMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableSmartAGDpiMonitorWithOptions(request, runtime);
}

model DisableSmartAccessGatewayUserRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-va03wf4l4idaj*****'),
  userName?: string(name='UserName', example='1234'),
}

model DisableSmartAccessGatewayUserResponseBody = {
  requestId?: string(name='RequestId', example='05E86199-6CF6-4F4E-A9CE-9BFC5B020B72'),
}

model DisableSmartAccessGatewayUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisableSmartAccessGatewayUserResponseBody(name='body'),
}

async function disableSmartAccessGatewayUserWithOptions(request: DisableSmartAccessGatewayUserRequest, runtime: Util.RuntimeOptions): DisableSmartAccessGatewayUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisableSmartAccessGatewayUser',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disableSmartAccessGatewayUser(request: DisableSmartAccessGatewayUserRequest): DisableSmartAccessGatewayUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return disableSmartAccessGatewayUserWithOptions(request, runtime);
}

model DisassociateACLRequest {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-ke3kq4evpi8****'),
}

model DisassociateACLResponseBody = {
  requestId?: string(name='RequestId', example='B28A9AB3-05BD-4A88-AB6A-A555A0BF70C0'),
}

model DisassociateACLResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisassociateACLResponseBody(name='body'),
}

async function disassociateACLWithOptions(request: DisassociateACLRequest, runtime: Util.RuntimeOptions): DisassociateACLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisassociateACL',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disassociateACL(request: DisassociateACLRequest): DisassociateACLResponse {
  var runtime = new Util.RuntimeOptions{};
  return disassociateACLWithOptions(request, runtime);
}

model DisassociateFlowLogRequest {
  flowLogId?: string(name='FlowLogId', example='fl-l934tsa5504yuc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-0v3pmd7qpnvx5f****'),
}

model DisassociateFlowLogResponseBody = {
  requestId?: string(name='RequestId', example='DD864F79-FDAC-4909-AFAF-84D1DCAF30A3'),
}

model DisassociateFlowLogResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisassociateFlowLogResponseBody(name='body'),
}

async function disassociateFlowLogWithOptions(request: DisassociateFlowLogRequest, runtime: Util.RuntimeOptions): DisassociateFlowLogResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisassociateFlowLog',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disassociateFlowLog(request: DisassociateFlowLogRequest): DisassociateFlowLogResponse {
  var runtime = new Util.RuntimeOptions{};
  return disassociateFlowLogWithOptions(request, runtime);
}

model DisassociateQosRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosId?: string(name='QosId', example='qos-1lcl9gv5ew7x****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-c3m3n1khz58l****'),
}

model DisassociateQosResponseBody = {
  requestId?: string(name='RequestId', example='551CD836-9E46-4F2C-A167-B4363180A647'),
}

model DisassociateQosResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DisassociateQosResponseBody(name='body'),
}

async function disassociateQosWithOptions(request: DisassociateQosRequest, runtime: Util.RuntimeOptions): DisassociateQosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DisassociateQos',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function disassociateQos(request: DisassociateQosRequest): DisassociateQosResponse {
  var runtime = new Util.RuntimeOptions{};
  return disassociateQosWithOptions(request, runtime);
}

model DiscribeSmartAccessGatewayDiagnosisReportRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
  smartAGSn?: string(name='SmartAGSn', example='sage62x022502****'),
}

model DiscribeSmartAccessGatewayDiagnosisReportResponseBody = {
  diagnoseResult?: {
    boxType?: string(name='BoxType', example='sag-1000'),
    boxVersion?: string(name='BoxVersion', example='2.1.0'),
    details?: [ 
      {
        items?: [ 
          {
            CN?: {
              advice?: [ string ](name='Advice'),
              details?: [ string ](name='Details'),
              itemLevel?: string(name='ItemLevel'),
              itemName?: string(name='ItemName'),
              itemType?: string(name='ItemType'),
            }(name='CN'),
            EN?: {
              advice?: [ string ](name='Advice'),
              details?: [ string ](name='Details'),
              itemLevel?: string(name='ItemLevel', example='ERROR'),
              itemName?: string(name='ItemName', example='Express Connect Port Configuration'),
              itemType?: string(name='ItemType', example='Config'),
            }(name='EN'),
            endTime?: long(name='EndTime', example='1602741570596'),
            itemName?: string(name='ItemName', example='eccConfigCheck'),
            level?: string(name='Level', example='error'),
            startTime?: long(name='StartTime', example='1602741570567'),
            type?: string(name='Type', example='config'),
          }
        ](name='Items'),
        statistics?: {
          error?: int32(name='Error', example='5'),
          info?: int32(name='Info', example='3'),
          total?: int32(name='Total', example='10'),
          warning?: int32(name='Warning', example='2'),
        }(name='Statistics'),
        type?: string(name='Type', example='config'),
      }
    ](name='Details'),
    diagnoseId?: string(name='DiagnoseId', example='dia-sag42c3t703trh02olv5rf****'),
    endTime?: int32(name='EndTime', example='160274157'),
    finishedNumber?: int32(name='FinishedNumber', example='15'),
    instanceId?: string(name='InstanceId', example='sag-0nnteglltw6z4b***'),
    level?: {
      biz?: string(name='Biz', example='warning'),
      configuration?: string(name='Configuration', example='info'),
      total?: string(name='Total', example='error'),
    }(name='Level'),
    monitorVersion?: string(name='MonitorVersion', example='2.0.2.9'),
    percent?: int32(name='Percent', example='100'),
    reportSLSSuccess?: int32(name='ReportSLSSuccess', example='0'),
    SN?: string(name='SN', example='sag42c3****'),
    startTime?: int32(name='StartTime', example='160274157'),
    state?: string(name='State', example='finished'),
    statistics?: {
      error?: int32(name='Error', example='2'),
      info?: int32(name='Info', example='5'),
      total?: int32(name='Total', example='10'),
      warning?: int32(name='Warning', example='3'),
    }(name='Statistics'),
    storeType?: string(name='StoreType', example='both'),
    totalNumber?: int32(name='TotalNumber', example='15'),
    UId?: string(name='UId', example='1688000000000000'),
    userLevel?: string(name='UserLevel', example='user'),
  }(name='DiagnoseResult'),
  requestId?: string(name='RequestId', example='D7D6E3AB-D41A-42E3-8D4E-97B145F4B7C3'),
}

model DiscribeSmartAccessGatewayDiagnosisReportResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DiscribeSmartAccessGatewayDiagnosisReportResponseBody(name='body'),
}

async function discribeSmartAccessGatewayDiagnosisReportWithOptions(request: DiscribeSmartAccessGatewayDiagnosisReportRequest, runtime: Util.RuntimeOptions): DiscribeSmartAccessGatewayDiagnosisReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DiscribeSmartAccessGatewayDiagnosisReport',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function discribeSmartAccessGatewayDiagnosisReport(request: DiscribeSmartAccessGatewayDiagnosisReportRequest): DiscribeSmartAccessGatewayDiagnosisReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return discribeSmartAccessGatewayDiagnosisReportWithOptions(request, runtime);
}

model DissociateSmartAGFromApplicationBandwidthPackageRequest {
  applicationBandwidthPackageId?: string(name='ApplicationBandwidthPackageId', example='abwp-7963l7iqnquyj3****'),
  clientToken?: string(name='ClientToken', example='02fb3da4-130e-11e9-8e44-001****'),
  dryRun?: boolean(name='DryRun', example='fasle'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  smartAGId?: string(name='SmartAGId', example='sag-w11hk4bqxpakem****'),
  smartAGIdList?: [ string ](name='SmartAGIdList'),
}

model DissociateSmartAGFromApplicationBandwidthPackageResponseBody = {
  requestId?: string(name='RequestId', example='4EC47282-1B74-4534-BD0E-403F3EE64CAF'),
}

model DissociateSmartAGFromApplicationBandwidthPackageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DissociateSmartAGFromApplicationBandwidthPackageResponseBody(name='body'),
}

async function dissociateSmartAGFromApplicationBandwidthPackageWithOptions(request: DissociateSmartAGFromApplicationBandwidthPackageRequest, runtime: Util.RuntimeOptions): DissociateSmartAGFromApplicationBandwidthPackageResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.applicationBandwidthPackageId)) {
    query['ApplicationBandwidthPackageId'] = request.applicationBandwidthPackageId;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGIdList)) {
    query['SmartAGIdList'] = request.smartAGIdList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DissociateSmartAGFromApplicationBandwidthPackage',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function dissociateSmartAGFromApplicationBandwidthPackage(request: DissociateSmartAGFromApplicationBandwidthPackageRequest): DissociateSmartAGFromApplicationBandwidthPackageResponse {
  var runtime = new Util.RuntimeOptions{};
  return dissociateSmartAGFromApplicationBandwidthPackageWithOptions(request, runtime);
}

model DowngradeSmartAccessGatewayRequest {
  autoPay?: boolean(name='AutoPay', example='true'),
  bandWidthSpec?: long(name='BandWidthSpec', example='20'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-nylv14tghsk26c*****'),
}

model DowngradeSmartAccessGatewayResponseBody = {
  orderId?: string(name='OrderId', example='20337777855****'),
  requestId?: string(name='RequestId', example='A6B9EB0F-57DB-4843-A372-04678ABF490E'),
}

model DowngradeSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DowngradeSmartAccessGatewayResponseBody(name='body'),
}

async function downgradeSmartAccessGatewayWithOptions(request: DowngradeSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): DowngradeSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.bandWidthSpec)) {
    query['BandWidthSpec'] = request.bandWidthSpec;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DowngradeSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function downgradeSmartAccessGateway(request: DowngradeSmartAccessGatewayRequest): DowngradeSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return downgradeSmartAccessGatewayWithOptions(request, runtime);
}

model DowngradeSmartAccessGatewaySoftwareRequest {
  autoPay?: boolean(name='AutoPay', example='false'),
  dataPlan?: long(name='DataPlan', example='5'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-n2uym2h45lnd31****'),
  userCount?: int32(name='UserCount', example='5'),
}

model DowngradeSmartAccessGatewaySoftwareResponseBody = {
  orderId?: string(name='OrderId', example='204595234160786'),
  requestId?: string(name='RequestId', example='3145AF24-1A5E-4AB7-90DA-7201FDD90B8D'),
}

model DowngradeSmartAccessGatewaySoftwareResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DowngradeSmartAccessGatewaySoftwareResponseBody(name='body'),
}

async function downgradeSmartAccessGatewaySoftwareWithOptions(request: DowngradeSmartAccessGatewaySoftwareRequest, runtime: Util.RuntimeOptions): DowngradeSmartAccessGatewaySoftwareResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.dataPlan)) {
    query['DataPlan'] = request.dataPlan;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userCount)) {
    query['UserCount'] = request.userCount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DowngradeSmartAccessGatewaySoftware',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function downgradeSmartAccessGatewaySoftware(request: DowngradeSmartAccessGatewaySoftwareRequest): DowngradeSmartAccessGatewaySoftwareResponse {
  var runtime = new Util.RuntimeOptions{};
  return downgradeSmartAccessGatewaySoftwareWithOptions(request, runtime);
}

model EnableSmartAGDpiMonitorRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4-130e-11e9****'),
  dryRun?: boolean(name='DryRun', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  slsLogStore?: string(name='SlsLogStore', example='test2'),
  slsProjectName?: string(name='SlsProjectName', example='test1'),
  smartAGId?: string(name='SmartAGId', example='sag-vwmylqc9521p5l****'),
}

model EnableSmartAGDpiMonitorResponseBody = {
  requestId?: string(name='RequestId', example='64966488-B3E3-41E2-9570-4596117EC12E'),
}

model EnableSmartAGDpiMonitorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableSmartAGDpiMonitorResponseBody(name='body'),
}

async function enableSmartAGDpiMonitorWithOptions(request: EnableSmartAGDpiMonitorRequest, runtime: Util.RuntimeOptions): EnableSmartAGDpiMonitorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.slsLogStore)) {
    query['SlsLogStore'] = request.slsLogStore;
  }
  if (!Util.isUnset(request.slsProjectName)) {
    query['SlsProjectName'] = request.slsProjectName;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableSmartAGDpiMonitor',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableSmartAGDpiMonitor(request: EnableSmartAGDpiMonitorRequest): EnableSmartAGDpiMonitorResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableSmartAGDpiMonitorWithOptions(request, runtime);
}

model EnableSmartAccessGatewayUserRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-va03wf4l4idaj*****'),
  userName?: string(name='UserName', example='1234'),
}

model EnableSmartAccessGatewayUserResponseBody = {
  requestId?: string(name='RequestId', example='F5894299-84A2-48C1-A999-28908B99F45D'),
}

model EnableSmartAccessGatewayUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EnableSmartAccessGatewayUserResponseBody(name='body'),
}

async function enableSmartAccessGatewayUserWithOptions(request: EnableSmartAccessGatewayUserRequest, runtime: Util.RuntimeOptions): EnableSmartAccessGatewayUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EnableSmartAccessGatewayUser',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function enableSmartAccessGatewayUser(request: EnableSmartAccessGatewayUserRequest): EnableSmartAccessGatewayUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return enableSmartAccessGatewayUserWithOptions(request, runtime);
}

model GetAclAttributeRequest {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0n*****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model GetAclAttributeResponseBody = {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0n*****'),
  aclName?: string(name='AclName', example='dpi_test'),
  errorConfigSmartAGCount?: int32(name='ErrorConfigSmartAGCount', example='0'),
  requestId?: string(name='RequestId', example='5D2013F0-85AB-4332-9094-8023A598C2C1'),
}

model GetAclAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAclAttributeResponseBody(name='body'),
}

async function getAclAttributeWithOptions(request: GetAclAttributeRequest, runtime: Util.RuntimeOptions): GetAclAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAclAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAclAttribute(request: GetAclAttributeRequest): GetAclAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAclAttributeWithOptions(request, runtime);
}

model GetAdvancedMonitorStateRequest {
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
}

model GetAdvancedMonitorStateResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      enable?: boolean(name='Enable'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model GetAdvancedMonitorStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAdvancedMonitorStateResponseBody(name='body'),
}

async function getAdvancedMonitorStateWithOptions(request: GetAdvancedMonitorStateRequest, runtime: Util.RuntimeOptions): GetAdvancedMonitorStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAdvancedMonitorState',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAdvancedMonitorState(request: GetAdvancedMonitorStateRequest): GetAdvancedMonitorStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAdvancedMonitorStateWithOptions(request, runtime);
}

model GetCloudConnectNetworkUseLimitRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetCloudConnectNetworkUseLimitResponseBody = {
  requestId?: string(name='RequestId', example='BCD04867-56C3-43DC-8FEF-923EFB8B56DA'),
  totalAmount?: int32(name='TotalAmount', example='10'),
  usedAmount?: int32(name='UsedAmount', example='6'),
}

model GetCloudConnectNetworkUseLimitResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCloudConnectNetworkUseLimitResponseBody(name='body'),
}

async function getCloudConnectNetworkUseLimitWithOptions(request: GetCloudConnectNetworkUseLimitRequest, runtime: Util.RuntimeOptions): GetCloudConnectNetworkUseLimitResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCloudConnectNetworkUseLimit',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCloudConnectNetworkUseLimit(request: GetCloudConnectNetworkUseLimitRequest): GetCloudConnectNetworkUseLimitResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCloudConnectNetworkUseLimitWithOptions(request, runtime);
}

model GetQosAttributeRequest {
  qosId?: string(name='QosId', example='qos-1iqifund3gcno5****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model GetQosAttributeResponseBody = {
  errorConfigSmartAGCount?: int32(name='ErrorConfigSmartAGCount', example='1'),
  qosCars?: [ 
    {
      limitType?: string(name='LimitType', example='Absolute'),
      maxBandwidthAbs?: int32(name='MaxBandwidthAbs', example='2'),
      maxBandwidthPercent?: int32(name='MaxBandwidthPercent', example='20'),
      minBandwidthAbs?: int32(name='MinBandwidthAbs', example='1'),
      minBandwidthPercent?: int32(name='MinBandwidthPercent', example='10'),
      percentSourceType?: string(name='PercentSourceType', example='InternetUpBandwidth'),
      priority?: int32(name='Priority', example='1'),
      qosCarDescription?: string(name='QosCarDescription', example='test'),
      qosCarId?: string(name='QosCarId', example='qoscar-xir1apa8ayjp56ei****'),
      qosCarName?: string(name='QosCarName', example='test'),
    }
  ](name='QosCars'),
  qosDescription?: string(name='QosDescription', example='test'),
  qosName?: string(name='QosName', example='test'),
  qosPolicies?: [ 
    {
      destCidr?: string(name='DestCidr', example='0.0.0.0/0'),
      destPortRange?: string(name='DestPortRange', example='-1/-1'),
      endTime?: long(name='EndTime', example='2021-07-29T00:00:00+0800'),
      ipProtocol?: string(name='IpProtocol', example='ALL'),
      priority?: int32(name='Priority', example='1'),
      qosPolicieDescription?: string(name='QosPolicieDescription', example='test'),
      qosPolicieName?: string(name='QosPolicieName', example='test'),
      sourceCidr?: string(name='SourceCidr', example='0.0.0.0/0'),
      sourcePortRange?: string(name='SourcePortRange', example='-1/-1'),
      startTime?: long(name='StartTime', example='2021-06-21T00:00:00+0800'),
    }
  ](name='QosPolicies'),
  requestId?: string(name='RequestId', example='91058E01-1806-45D5-B305-19E4D0A5CE04'),
}

model GetQosAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetQosAttributeResponseBody(name='body'),
}

/**
  * ****
  *
  * @param request GetQosAttributeRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetQosAttributeResponse
 */
async function getQosAttributeWithOptions(request: GetQosAttributeRequest, runtime: Util.RuntimeOptions): GetQosAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetQosAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * ****
  *
  * @param request GetQosAttributeRequest
  * @return GetQosAttributeResponse
 */
async function getQosAttribute(request: GetQosAttributeRequest): GetQosAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getQosAttributeWithOptions(request, runtime);
}

model GetSmartAGDpiAttributeRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-tq3sazs17smldn****'),
}

model GetSmartAGDpiAttributeResponseBody = {
  dpiMonitorStatus?: string(name='DpiMonitorStatus', example='Inactive'),
  dpiStatus?: string(name='DpiStatus', example='On'),
  logstoreName?: string(name='LogstoreName', example='test1'),
  projectName?: string(name='ProjectName', example='test2'),
  requestId?: string(name='RequestId', example='B2997DC4-F1A2-418B-81FC-C8892CD31CFF'),
  slsRegion?: string(name='SlsRegion', example='cn-shanghai'),
}

model GetSmartAGDpiAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetSmartAGDpiAttributeResponseBody(name='body'),
}

async function getSmartAGDpiAttributeWithOptions(request: GetSmartAGDpiAttributeRequest, runtime: Util.RuntimeOptions): GetSmartAGDpiAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSmartAGDpiAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getSmartAGDpiAttribute(request: GetSmartAGDpiAttributeRequest): GetSmartAGDpiAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSmartAGDpiAttributeWithOptions(request, runtime);
}

model GetSmartAccessGatewayUseLimitRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetSmartAccessGatewayUseLimitResponseBody = {
  requestId?: string(name='RequestId', example='2265DB11-F5CC-496E-ADE7-D043AC37926A'),
  totalAmount?: int32(name='TotalAmount', example='500'),
  usedAmount?: int32(name='UsedAmount', example='47'),
}

model GetSmartAccessGatewayUseLimitResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetSmartAccessGatewayUseLimitResponseBody(name='body'),
}

async function getSmartAccessGatewayUseLimitWithOptions(request: GetSmartAccessGatewayUseLimitRequest, runtime: Util.RuntimeOptions): GetSmartAccessGatewayUseLimitResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSmartAccessGatewayUseLimit',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getSmartAccessGatewayUseLimit(request: GetSmartAccessGatewayUseLimitRequest): GetSmartAccessGatewayUseLimitResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSmartAccessGatewayUseLimitWithOptions(request, runtime);
}

model GrantInstanceToCbnRequest {
  ccnInstanceId?: string(name='CcnInstanceId', example='ccn-n2935s1mnwv8i*****'),
  cenInstanceId?: string(name='CenInstanceId', example='cen-7qthudw0ll6jm*****'),
  cenUid?: long(name='CenUid', example='1250123456123456'),
  grantTrafficService?: boolean(name='GrantTrafficService', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GrantInstanceToCbnResponseBody = {
  requestId?: string(name='RequestId', example='22840034-ADE9-41D8-A5DC-A7CF435CEE75'),
}

model GrantInstanceToCbnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GrantInstanceToCbnResponseBody(name='body'),
}

async function grantInstanceToCbnWithOptions(request: GrantInstanceToCbnRequest, runtime: Util.RuntimeOptions): GrantInstanceToCbnResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnInstanceId)) {
    query['CcnInstanceId'] = request.ccnInstanceId;
  }
  if (!Util.isUnset(request.cenInstanceId)) {
    query['CenInstanceId'] = request.cenInstanceId;
  }
  if (!Util.isUnset(request.cenUid)) {
    query['CenUid'] = request.cenUid;
  }
  if (!Util.isUnset(request.grantTrafficService)) {
    query['GrantTrafficService'] = request.grantTrafficService;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantInstanceToCbn',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function grantInstanceToCbn(request: GrantInstanceToCbnRequest): GrantInstanceToCbnResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantInstanceToCbnWithOptions(request, runtime);
}

model GrantSagInstanceToCcnRequest {
  ccnInstanceId?: string(name='CcnInstanceId', example='ccn-n2935s1mnwv8i*****'),
  ccnUid?: long(name='CcnUid', example='1210123456123456'),
  grantTrafficService?: boolean(name='GrantTrafficService', example='true'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-tzirqx07bvcngm****'),
}

model GrantSagInstanceToCcnResponseBody = {
  instanceId?: string(name='InstanceId', example='sgc-6z21oj0vjjrx6s****'),
  requestId?: string(name='RequestId', example='6E1674AC-083C-4031-B047-7A66E418E0C6'),
}

model GrantSagInstanceToCcnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GrantSagInstanceToCcnResponseBody(name='body'),
}

async function grantSagInstanceToCcnWithOptions(request: GrantSagInstanceToCcnRequest, runtime: Util.RuntimeOptions): GrantSagInstanceToCcnResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnInstanceId)) {
    query['CcnInstanceId'] = request.ccnInstanceId;
  }
  if (!Util.isUnset(request.ccnUid)) {
    query['CcnUid'] = request.ccnUid;
  }
  if (!Util.isUnset(request.grantTrafficService)) {
    query['GrantTrafficService'] = request.grantTrafficService;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantSagInstanceToCcn',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function grantSagInstanceToCcn(request: GrantSagInstanceToCcnRequest): GrantSagInstanceToCcnResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantSagInstanceToCcnWithOptions(request, runtime);
}

model GrantSagInstanceToVbrRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-0nnteglltw6z4b****'),
  vbrInstanceId?: string(name='VbrInstanceId', example='vbr-bp13gtbhdp0pfqg6s****'),
  vbrRegionId?: string(name='VbrRegionId', example='cn-hangzhou'),
  vbrUid?: long(name='VbrUid', example='1231212121121212112'),
}

model GrantSagInstanceToVbrResponseBody = {
  instanceId?: string(name='InstanceId', example='sgv-3x8djyem7vqh70****'),
  requestId?: string(name='RequestId', example='49CEBB2B-9E5C-4789-8A29-3255A56A67B1'),
}

model GrantSagInstanceToVbrResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GrantSagInstanceToVbrResponseBody(name='body'),
}

async function grantSagInstanceToVbrWithOptions(request: GrantSagInstanceToVbrRequest, runtime: Util.RuntimeOptions): GrantSagInstanceToVbrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.vbrInstanceId)) {
    query['VbrInstanceId'] = request.vbrInstanceId;
  }
  if (!Util.isUnset(request.vbrRegionId)) {
    query['VbrRegionId'] = request.vbrRegionId;
  }
  if (!Util.isUnset(request.vbrUid)) {
    query['VbrUid'] = request.vbrUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantSagInstanceToVbr',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function grantSagInstanceToVbr(request: GrantSagInstanceToVbrRequest): GrantSagInstanceToVbrResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantSagInstanceToVbrWithOptions(request, runtime);
}

model KickOutClientsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-ehjfb*******'),
  username?: string(name='Username', example='doctest'),
}

model KickOutClientsResponseBody = {
  requestId?: string(name='RequestId', example='76FD7E08-6AA1-4B1B-99FB-8B3CA6C99A8E'),
}

model KickOutClientsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: KickOutClientsResponseBody(name='body'),
}

async function kickOutClientsWithOptions(request: KickOutClientsRequest, runtime: Util.RuntimeOptions): KickOutClientsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.username)) {
    query['Username'] = request.username;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'KickOutClients',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function kickOutClients(request: KickOutClientsRequest): KickOutClientsResponse {
  var runtime = new Util.RuntimeOptions{};
  return kickOutClientsWithOptions(request, runtime);
}

model ListAccessPointNetworkQualitiesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-p86e06z4geaji1****'),
}

model ListAccessPointNetworkQualitiesResponseBody = {
  accessPointNetworkQualities?: [ 
    {
      id?: int32(name='Id', example='115'),
      loss?: string(name='Loss', example='0.00%'),
      rtt?: string(name='Rtt', example='4.98'),
    }
  ](name='AccessPointNetworkQualities'),
  requestId?: string(name='RequestId', example='8E8E8C86-1404-122A-A1BB-84BBC2E9A4B1'),
}

model ListAccessPointNetworkQualitiesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAccessPointNetworkQualitiesResponseBody(name='body'),
}

async function listAccessPointNetworkQualitiesWithOptions(request: ListAccessPointNetworkQualitiesRequest, runtime: Util.RuntimeOptions): ListAccessPointNetworkQualitiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAccessPointNetworkQualities',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAccessPointNetworkQualities(request: ListAccessPointNetworkQualitiesRequest): ListAccessPointNetworkQualitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAccessPointNetworkQualitiesWithOptions(request, runtime);
}

model ListAccessPointsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-far8v6owtdxlua****'),
}

model ListAccessPointsResponseBody = {
  accessPoints?: [ 
    {
      accessPointId?: int32(name='AccessPointId', example='401'),
      activeSmartAGCount?: int32(name='ActiveSmartAGCount', example='0'),
      inactiveSmartAGCount?: int32(name='InactiveSmartAGCount', example='7'),
      latitude?: string(name='Latitude', example='103.81****'),
      longitude?: string(name='Longitude', example='1.35****'),
    }
  ](name='AccessPoints'),
  requestId?: string(name='RequestId', example='E26DBAAE-A796-4A48-98B4-B45AFCD1F299'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model ListAccessPointsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAccessPointsResponseBody(name='body'),
}

async function listAccessPointsWithOptions(request: ListAccessPointsRequest, runtime: Util.RuntimeOptions): ListAccessPointsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAccessPoints',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAccessPoints(request: ListAccessPointsRequest): ListAccessPointsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAccessPointsWithOptions(request, runtime);
}

model ListAvailableServiceAddressRequest {
  addressType?: string(name='AddressType'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sn?: string(name='Sn'),
}

model ListAvailableServiceAddressResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      address?: string(name='Address'),
      addressType?: string(name='AddressType'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model ListAvailableServiceAddressResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAvailableServiceAddressResponseBody(name='body'),
}

async function listAvailableServiceAddressWithOptions(request: ListAvailableServiceAddressRequest, runtime: Util.RuntimeOptions): ListAvailableServiceAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListAvailableServiceAddress',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listAvailableServiceAddress(request: ListAvailableServiceAddressRequest): ListAvailableServiceAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAvailableServiceAddressWithOptions(request, runtime);
}

model ListDpiConfigErrorRequest {
  dpiConfigType?: string(name='DpiConfigType', example='qos'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  ruleInstanceId?: string(name='RuleInstanceId', example='qos-1strcafl4wghpb****'),
  smartAGId?: string(name='SmartAGId', example='sag-1e8sgws6b133b8****'),
}

model ListDpiConfigErrorResponseBody = {
  dpiConfigError?: [ 
    {
      errorType?: string(name='ErrorType', example='DeviceNotSupported'),
      ruleConfigErrorList?: [ 
        {
          dpiGroupIds?: [ string ](name='DpiGroupIds'),
          dpiSignatureIds?: [ string ](name='DpiSignatureIds'),
          ruleId?: string(name='RuleId', example='qospy-axud4s62gz632b****'),
        }
      ](name='RuleConfigErrorList'),
      SN?: string(name='SN', example='sag-2160808****'),
      smartAGId?: string(name='SmartAGId', example='sag-1e8sgws6b133b8****'),
    }
  ](name='DpiConfigError'),
  maxResults?: int32(name='MaxResults', example='10'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0a****'),
  requestId?: string(name='RequestId', example='F47B5293-27B6-48EF-A9C6-E90A41449813'),
  total?: int32(name='Total', example='1'),
}

model ListDpiConfigErrorResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDpiConfigErrorResponseBody(name='body'),
}

async function listDpiConfigErrorWithOptions(request: ListDpiConfigErrorRequest, runtime: Util.RuntimeOptions): ListDpiConfigErrorResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dpiConfigType)) {
    query['DpiConfigType'] = request.dpiConfigType;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.ruleInstanceId)) {
    query['RuleInstanceId'] = request.ruleInstanceId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDpiConfigError',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDpiConfigError(request: ListDpiConfigErrorRequest): ListDpiConfigErrorResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDpiConfigErrorWithOptions(request, runtime);
}

model ListDpiGroupsRequest {
  dpiGroupIds?: [ string ](name='DpiGroupIds', example='1'),
  dpiGroupNames?: [ string ](name='DpiGroupNames', example='P2P'),
  maxResults?: int32(name='MaxResults', example='3'),
  nextToken?: string(name='NextToken', example='FFPSpX59Eb****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListDpiGroupsResponseBody = {
  dpiGroup?: [ 
    {
      dpiGroupId?: string(name='DpiGroupId', example='1'),
      dpiGroupName?: string(name='DpiGroupName', example='P2P'),
      minEngineVersion?: string(name='MinEngineVersion', example='0-0.0.1'),
      minSignatureDbVersion?: string(name='MinSignatureDbVersion', example='20201117_1_0-0.0.1'),
    }
  ](name='DpiGroup'),
  nextToken?: string(name='NextToken', example='FFPSpX59Ebw****'),
  requestId?: string(name='RequestId', example='EC184A86-3C93-49D6-BB34-6C193E14D37F'),
  totalCount?: int32(name='TotalCount', example='22'),
}

model ListDpiGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDpiGroupsResponseBody(name='body'),
}

async function listDpiGroupsWithOptions(request: ListDpiGroupsRequest, runtime: Util.RuntimeOptions): ListDpiGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dpiGroupIds)) {
    query['DpiGroupIds'] = request.dpiGroupIds;
  }
  if (!Util.isUnset(request.dpiGroupNames)) {
    query['DpiGroupNames'] = request.dpiGroupNames;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDpiGroups',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDpiGroups(request: ListDpiGroupsRequest): ListDpiGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDpiGroupsWithOptions(request, runtime);
}

model ListDpiSignaturesRequest {
  dpiGroupId?: string(name='DpiGroupId', example='20'),
  dpiSignatureIds?: [ string ](name='DpiSignatureIds', example='235'),
  dpiSignatureNames?: [ string ](name='DpiSignatureNames', example='EdgeCast'),
  maxResults?: int32(name='MaxResults', example='20'),
  nextToken?: string(name='NextToken', example='caeba0bbb2****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ListDpiSignaturesResponseBody = {
  dpiSignature?: [ 
    {
      dpiGroupId?: string(name='DpiGroupId', example='20'),
      dpiSignatureId?: string(name='DpiSignatureId', example='235'),
      dpiSignatureName?: string(name='DpiSignatureName', example='EdgeCast'),
      minEngineVersion?: string(name='MinEngineVersion', example='0-0.0.1'),
      minSignatureDbVersion?: string(name='MinSignatureDbVersion', example='20201117_1_0-0.0.1'),
    }
  ](name='DpiSignature'),
  nextToken?: string(name='NextToken', example='FFrMV38kR4****'),
  requestId?: string(name='RequestId', example='63081123-B7C0-4BC9-B9E5-59E77A616EC9'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model ListDpiSignaturesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDpiSignaturesResponseBody(name='body'),
}

async function listDpiSignaturesWithOptions(request: ListDpiSignaturesRequest, runtime: Util.RuntimeOptions): ListDpiSignaturesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dpiGroupId)) {
    query['DpiGroupId'] = request.dpiGroupId;
  }
  if (!Util.isUnset(request.dpiSignatureIds)) {
    query['DpiSignatureIds'] = request.dpiSignatureIds;
  }
  if (!Util.isUnset(request.dpiSignatureNames)) {
    query['DpiSignatureNames'] = request.dpiSignatureNames;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDpiSignatures',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDpiSignatures(request: ListDpiSignaturesRequest): ListDpiSignaturesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDpiSignaturesWithOptions(request, runtime);
}

model ListEnterpriseCodeRequest {
  enterpriseCode?: string(name='EnterpriseCode', example='12P**'),
  isDefault?: boolean(name='IsDefault', example='false'),
  maxResults?: int32(name='MaxResults', example='2'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0*****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model ListEnterpriseCodeResponseBody = {
  enterpriseCodes?: [ 
    {
      enterpriseCode?: string(name='EnterpriseCode', example='12P**'),
      isDefault?: boolean(name='IsDefault', example='true'),
    }
  ](name='EnterpriseCodes'),
  maxResults?: int32(name='MaxResults', example='2'),
  nextToken?: string(name='NextToken', example='caeba0bbb2be03f84eb48b699f0*****'),
  requestId?: string(name='RequestId', example='1A57EF84-D587-4CF9-B0C8-307488BF52C9'),
  totalCount?: int32(name='TotalCount', example='2'),
}

model ListEnterpriseCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListEnterpriseCodeResponseBody(name='body'),
}

async function listEnterpriseCodeWithOptions(request: ListEnterpriseCodeRequest, runtime: Util.RuntimeOptions): ListEnterpriseCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enterpriseCode)) {
    query['EnterpriseCode'] = request.enterpriseCode;
  }
  if (!Util.isUnset(request.isDefault)) {
    query['IsDefault'] = request.isDefault;
  }
  if (!Util.isUnset(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!Util.isUnset(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEnterpriseCode',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listEnterpriseCode(request: ListEnterpriseCodeRequest): ListEnterpriseCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEnterpriseCodeWithOptions(request, runtime);
}

model ListProbeTaskRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  probeTaskId?: string(name='ProbeTaskId'),
  protocol?: string(name='Protocol'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sagName?: string(name='SagName'),
  sn?: string(name='Sn'),
  taskName?: string(name='TaskName'),
}

model ListProbeTaskResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      domain?: string(name='Domain'),
      enable?: boolean(name='Enable'),
      gmtCreate?: string(name='GmtCreate'),
      gmtModify?: string(name='GmtModify'),
      packetNumber?: int32(name='PacketNumber'),
      port?: int32(name='Port'),
      probeTaskId?: string(name='ProbeTaskId'),
      probeTaskSourceAddress?: string(name='ProbeTaskSourceAddress'),
      protocol?: string(name='Protocol'),
      sagId?: string(name='SagId'),
      sn?: string(name='Sn'),
      taskName?: string(name='TaskName'),
      type?: string(name='Type'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListProbeTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListProbeTaskResponseBody(name='body'),
}

async function listProbeTaskWithOptions(request: ListProbeTaskRequest, runtime: Util.RuntimeOptions): ListProbeTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.probeTaskId)) {
    query['ProbeTaskId'] = request.probeTaskId;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sagName)) {
    query['SagName'] = request.sagName;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProbeTask',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listProbeTask(request: ListProbeTaskRequest): ListProbeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return listProbeTaskWithOptions(request, runtime);
}

model ListSmartAGApiUnsupportedFeatureRequest {
  openApiName?: string(name='OpenApiName', example='ModifySagWan'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sage62x052614****'),
  smartAGId?: string(name='SmartAGId', example='sag-4d6i45zess8nj4****'),
}

model ListSmartAGApiUnsupportedFeatureResponseBody = {
  features?: [ 
    {
      feature?: string(name='Feature', example='ISP'),
    }
  ](name='Features'),
  requestId?: string(name='RequestId', example='7459545D-2F0D-43E6-9957-CB7E0223332B'),
}

model ListSmartAGApiUnsupportedFeatureResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSmartAGApiUnsupportedFeatureResponseBody(name='body'),
}

async function listSmartAGApiUnsupportedFeatureWithOptions(request: ListSmartAGApiUnsupportedFeatureRequest, runtime: Util.RuntimeOptions): ListSmartAGApiUnsupportedFeatureResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.openApiName)) {
    query['OpenApiName'] = request.openApiName;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSmartAGApiUnsupportedFeature',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listSmartAGApiUnsupportedFeature(request: ListSmartAGApiUnsupportedFeatureRequest): ListSmartAGApiUnsupportedFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSmartAGApiUnsupportedFeatureWithOptions(request, runtime);
}

model ListSmartAGByAccessPointRequest {
  accessPointId?: int32(name='AccessPointId', example='238'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='5'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGStatus?: string(name='SmartAGStatus', example='Active'),
}

model ListSmartAGByAccessPointResponseBody = {
  requestId?: string(name='RequestId', example='AE203140-5D0C-4B4D-88D1-D008206B3A01'),
  smartAccessGateways?: [ 
    {
      associatedCcnId?: string(name='AssociatedCcnId', example='ccn-l42qf3vpvb****'),
      hardwareVersion?: string(name='HardwareVersion', example='sag-1000'),
      routingStrategy?: string(name='RoutingStrategy', example='static'),
      smartAGDescription?: string(name='SmartAGDescription', example='test'),
      smartAGId?: string(name='SmartAGId', example='sag-p86e06z4geaji1****'),
      smartAGName?: string(name='SmartAGName', example='test'),
      smartAGStatus?: string(name='SmartAGStatus', example='Active'),
    }
  ](name='SmartAccessGateways'),
  totalCount?: int32(name='TotalCount', example='16'),
}

model ListSmartAGByAccessPointResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSmartAGByAccessPointResponseBody(name='body'),
}

async function listSmartAGByAccessPointWithOptions(request: ListSmartAGByAccessPointRequest, runtime: Util.RuntimeOptions): ListSmartAGByAccessPointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPointId)) {
    query['AccessPointId'] = request.accessPointId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGStatus)) {
    query['SmartAGStatus'] = request.smartAGStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSmartAGByAccessPoint',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listSmartAGByAccessPoint(request: ListSmartAGByAccessPointRequest): ListSmartAGByAccessPointResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSmartAGByAccessPointWithOptions(request, runtime);
}

model ModifyACLRequest {
  aclId?: string(name='AclId', example='acl-e30a66to95cs****'),
  name?: string(name='Name', example='newname'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyACLResponseBody = {
  requestId?: string(name='RequestId', example='076FD0BE-67D5-4338-A2A1-C54DE7D78B16'),
}

model ModifyACLResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyACLResponseBody(name='body'),
}

async function modifyACLWithOptions(request: ModifyACLRequest, runtime: Util.RuntimeOptions): ModifyACLResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyACL',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyACL(request: ModifyACLRequest): ModifyACLResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyACLWithOptions(request, runtime);
}

model ModifyACLRuleRequest {
  aclId?: string(name='AclId', example='acl-xhwhyuo43l0n*******'),
  acrId?: string(name='AcrId', example='acr-u98qztgtgvhb********'),
  description?: string(name='Description', example='test'),
  destCidr?: string(name='DestCidr', example='0.0.0.0/0'),
  destPortRange?: string(name='DestPortRange', example='80/80'),
  direction?: string(name='Direction', example='in'),
  dpiGroupIds?: [ string ](name='DpiGroupIds'),
  dpiSignatureIds?: [ string ](name='DpiSignatureIds'),
  ipProtocol?: string(name='IpProtocol', example='tcp'),
  name?: string(name='Name', example='doctest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  policy?: string(name='Policy', example='accept'),
  priority?: int32(name='Priority', example='2'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceCidr?: string(name='SourceCidr', example='0.0.0.0/0'),
  sourcePortRange?: string(name='SourcePortRange', example='80/80'),
  type?: string(name='Type', example='LAN'),
}

model ModifyACLRuleResponseBody = {
  aclId?: string(name='AclId', example='acl-jdc7tir4fkplwr****'),
  acrId?: string(name='AcrId', example='acr-r8hezn2pi39s5a****'),
  description?: string(name='Description', example='test'),
  destCidr?: string(name='DestCidr', example='0.0.0.0/0'),
  destPortRange?: string(name='DestPortRange', example='-1/-1'),
  direction?: string(name='Direction', example='in'),
  dpiGroupIds?: {
    dpiGroupId?: [ string ](name='DpiGroupId')
  }(name='DpiGroupIds'),
  dpiSignatureIds?: {
    dpiSignatureId?: [ string ](name='DpiSignatureId')
  }(name='DpiSignatureIds'),
  gmtCreate?: long(name='GmtCreate', example='1553777700000'),
  ipProtocol?: string(name='IpProtocol', example='ALL'),
  name?: string(name='Name', example='doctest'),
  policy?: string(name='Policy', example='accept'),
  priority?: int32(name='Priority', example='1'),
  requestId?: string(name='RequestId', example='7F3DD2C1-0F6B-4575-9106-B2D50DF7A711'),
  sourceCidr?: string(name='SourceCidr', example='0.0.0.0/0'),
  sourcePortRange?: string(name='SourcePortRange', example='-1/-1'),
}

model ModifyACLRuleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyACLRuleResponseBody(name='body'),
}

async function modifyACLRuleWithOptions(request: ModifyACLRuleRequest, runtime: Util.RuntimeOptions): ModifyACLRuleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aclId)) {
    query['AclId'] = request.aclId;
  }
  if (!Util.isUnset(request.acrId)) {
    query['AcrId'] = request.acrId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.destCidr)) {
    query['DestCidr'] = request.destCidr;
  }
  if (!Util.isUnset(request.destPortRange)) {
    query['DestPortRange'] = request.destPortRange;
  }
  if (!Util.isUnset(request.direction)) {
    query['Direction'] = request.direction;
  }
  if (!Util.isUnset(request.dpiGroupIds)) {
    query['DpiGroupIds'] = request.dpiGroupIds;
  }
  if (!Util.isUnset(request.dpiSignatureIds)) {
    query['DpiSignatureIds'] = request.dpiSignatureIds;
  }
  if (!Util.isUnset(request.ipProtocol)) {
    query['IpProtocol'] = request.ipProtocol;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.policy)) {
    query['Policy'] = request.policy;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceCidr)) {
    query['SourceCidr'] = request.sourceCidr;
  }
  if (!Util.isUnset(request.sourcePortRange)) {
    query['SourcePortRange'] = request.sourcePortRange;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyACLRule',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyACLRule(request: ModifyACLRuleRequest): ModifyACLRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyACLRuleWithOptions(request, runtime);
}

model ModifyClientUserDNSRequest {
  appDNS?: [ string ](name='AppDNS', example='100.XX.XX.100'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  recoveredDNS?: [ string ](name='RecoveredDNS', example='100.XX.XX.110'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-9uyg53s6juhpxv****'),
}

model ModifyClientUserDNSResponseBody = {
  requestId?: string(name='RequestId', example='BFE2D0C0-B69F-422D-A8A3-928AD511B471'),
}

model ModifyClientUserDNSResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyClientUserDNSResponseBody(name='body'),
}

async function modifyClientUserDNSWithOptions(request: ModifyClientUserDNSRequest, runtime: Util.RuntimeOptions): ModifyClientUserDNSResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appDNS)) {
    query['AppDNS'] = request.appDNS;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.recoveredDNS)) {
    query['RecoveredDNS'] = request.recoveredDNS;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyClientUserDNS',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyClientUserDNS(request: ModifyClientUserDNSRequest): ModifyClientUserDNSResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyClientUserDNSWithOptions(request, runtime);
}

model ModifyCloudConnectNetworkRequest {
  ccnId?: string(name='CcnId', example='ccn-l9340rlu5ens*****'),
  cidrBlock?: string(name='CidrBlock', example='10.10.10.0/24'),
  description?: string(name='Description'),
  interworkingStatus?: string(name='InterworkingStatus', example='enable'),
  name?: string(name='Name'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyCloudConnectNetworkResponseBody = {
  requestId?: string(name='RequestId', example='0BAAF2B9-88B8-4574-BDBE-102A90EE3FEE'),
}

model ModifyCloudConnectNetworkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyCloudConnectNetworkResponseBody(name='body'),
}

async function modifyCloudConnectNetworkWithOptions(request: ModifyCloudConnectNetworkRequest, runtime: Util.RuntimeOptions): ModifyCloudConnectNetworkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnId)) {
    query['CcnId'] = request.ccnId;
  }
  if (!Util.isUnset(request.cidrBlock)) {
    query['CidrBlock'] = request.cidrBlock;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.interworkingStatus)) {
    query['InterworkingStatus'] = request.interworkingStatus;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyCloudConnectNetwork',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyCloudConnectNetwork(request: ModifyCloudConnectNetworkRequest): ModifyCloudConnectNetworkResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyCloudConnectNetworkWithOptions(request, runtime);
}

model ModifyDeviceAutoUpgradePolicyRequest {
  cronExpression?: string(name='CronExpression', example='0 0 4 1/1 * ?'),
  duration?: int32(name='Duration', example='30'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sage62x022502****'),
  smartAGId?: string(name='SmartAGId', example='sag-1um5x5nwhilymw****'),
  timeZone?: string(name='TimeZone', example='Asia/Shanghai'),
  upgradeType?: string(name='UpgradeType', example='scheduled'),
  versionType?: string(name='VersionType', example='Device'),
}

model ModifyDeviceAutoUpgradePolicyResponseBody = {
  requestId?: string(name='RequestId', example='F03C6897-2284-4BC8-94B4-1467BD992A2D'),
}

model ModifyDeviceAutoUpgradePolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyDeviceAutoUpgradePolicyResponseBody(name='body'),
}

async function modifyDeviceAutoUpgradePolicyWithOptions(request: ModifyDeviceAutoUpgradePolicyRequest, runtime: Util.RuntimeOptions): ModifyDeviceAutoUpgradePolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cronExpression)) {
    query['CronExpression'] = request.cronExpression;
  }
  if (!Util.isUnset(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.timeZone)) {
    query['TimeZone'] = request.timeZone;
  }
  if (!Util.isUnset(request.upgradeType)) {
    query['UpgradeType'] = request.upgradeType;
  }
  if (!Util.isUnset(request.versionType)) {
    query['VersionType'] = request.versionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyDeviceAutoUpgradePolicy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyDeviceAutoUpgradePolicy(request: ModifyDeviceAutoUpgradePolicyRequest): ModifyDeviceAutoUpgradePolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDeviceAutoUpgradePolicyWithOptions(request, runtime);
}

model ModifyFlowLogAttributeRequest {
  activeAging?: int32(name='ActiveAging', example='300'),
  description?: string(name='Description'),
  flowLogId?: string(name='FlowLogId', example='fl-7a56mar1kfw9vj****'),
  inactiveAging?: int32(name='InactiveAging', example='15'),
  logstoreName?: string(name='LogstoreName', example='ssfghgh'),
  name?: string(name='Name', example='DDE'),
  netflowServerIp?: string(name='NetflowServerIp', example='192.168.0.2'),
  netflowServerPort?: int32(name='NetflowServerPort', example='9995'),
  netflowVersion?: string(name='NetflowVersion', example='V9'),
  outputType?: string(name='OutputType', example='sls'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  projectName?: string(name='ProjectName', example='ddrrgt'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  slsRegionId?: string(name='SlsRegionId', example='cn-shanghai'),
}

model ModifyFlowLogAttributeResponseBody = {
  requestId?: string(name='RequestId', example='AAC70A63-1A2E-4857-9CA3-5DE5B4041D1E'),
}

model ModifyFlowLogAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyFlowLogAttributeResponseBody(name='body'),
}

async function modifyFlowLogAttributeWithOptions(request: ModifyFlowLogAttributeRequest, runtime: Util.RuntimeOptions): ModifyFlowLogAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.activeAging)) {
    query['ActiveAging'] = request.activeAging;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.flowLogId)) {
    query['FlowLogId'] = request.flowLogId;
  }
  if (!Util.isUnset(request.inactiveAging)) {
    query['InactiveAging'] = request.inactiveAging;
  }
  if (!Util.isUnset(request.logstoreName)) {
    query['LogstoreName'] = request.logstoreName;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.netflowServerIp)) {
    query['NetflowServerIp'] = request.netflowServerIp;
  }
  if (!Util.isUnset(request.netflowServerPort)) {
    query['NetflowServerPort'] = request.netflowServerPort;
  }
  if (!Util.isUnset(request.netflowVersion)) {
    query['NetflowVersion'] = request.netflowVersion;
  }
  if (!Util.isUnset(request.outputType)) {
    query['OutputType'] = request.outputType;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.slsRegionId)) {
    query['SlsRegionId'] = request.slsRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyFlowLogAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyFlowLogAttribute(request: ModifyFlowLogAttributeRequest): ModifyFlowLogAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyFlowLogAttributeWithOptions(request, runtime);
}

model ModifyHealthCheckRequest {
  description?: string(name='Description'),
  dstIpAddr?: string(name='DstIpAddr', example='192.XX.XX.1'),
  dstPort?: int32(name='DstPort', example='2233'),
  failCountThreshold?: int32(name='FailCountThreshold', example='3'),
  hcInstanceId?: string(name='HcInstanceId', example='hc-k9id4loo3lup57****'),
  name?: string(name='Name', example='sss333'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  probeCount?: int32(name='ProbeCount', example='1'),
  probeInterval?: int32(name='ProbeInterval', example='2000'),
  probeTimeout?: int32(name='ProbeTimeout', example='3000'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  rttFailThreshold?: int32(name='RttFailThreshold', example='3'),
  rttThreshold?: int32(name='RttThreshold', example='3'),
  smartAGId?: string(name='SmartAGId', example='sag-i0e85k06v1mzpo****'),
  srcIpAddr?: string(name='SrcIpAddr', example='192.XX.XX.1'),
  srcPort?: int32(name='SrcPort', example='3333'),
  type?: string(name='Type', example='ICMP_ECHO'),
}

model ModifyHealthCheckResponseBody = {
  requestId?: string(name='RequestId', example='F0290F85-8087-4FB7-81F8-84226A4DAAB2'),
}

model ModifyHealthCheckResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyHealthCheckResponseBody(name='body'),
}

async function modifyHealthCheckWithOptions(request: ModifyHealthCheckRequest, runtime: Util.RuntimeOptions): ModifyHealthCheckResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.dstIpAddr)) {
    query['DstIpAddr'] = request.dstIpAddr;
  }
  if (!Util.isUnset(request.dstPort)) {
    query['DstPort'] = request.dstPort;
  }
  if (!Util.isUnset(request.failCountThreshold)) {
    query['FailCountThreshold'] = request.failCountThreshold;
  }
  if (!Util.isUnset(request.hcInstanceId)) {
    query['HcInstanceId'] = request.hcInstanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.probeCount)) {
    query['ProbeCount'] = request.probeCount;
  }
  if (!Util.isUnset(request.probeInterval)) {
    query['ProbeInterval'] = request.probeInterval;
  }
  if (!Util.isUnset(request.probeTimeout)) {
    query['ProbeTimeout'] = request.probeTimeout;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.rttFailThreshold)) {
    query['RttFailThreshold'] = request.rttFailThreshold;
  }
  if (!Util.isUnset(request.rttThreshold)) {
    query['RttThreshold'] = request.rttThreshold;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.srcIpAddr)) {
    query['SrcIpAddr'] = request.srcIpAddr;
  }
  if (!Util.isUnset(request.srcPort)) {
    query['SrcPort'] = request.srcPort;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyHealthCheck',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyHealthCheck(request: ModifyHealthCheckRequest): ModifyHealthCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyHealthCheckWithOptions(request, runtime);
}

model ModifyQosRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  qosDescription?: string(name='QosDescription', example='qosdes'),
  qosId?: string(name='QosId', example='qos-awfxl1adxeqyk****'),
  qosName?: string(name='QosName', example='doctest'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyQosResponseBody = {
  requestId?: string(name='RequestId', example='EE837E9F-BD50-4C2B-9E47-260F9D848480'),
}

model ModifyQosResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyQosResponseBody(name='body'),
}

async function modifyQosWithOptions(request: ModifyQosRequest, runtime: Util.RuntimeOptions): ModifyQosResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.qosDescription)) {
    query['QosDescription'] = request.qosDescription;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.qosName)) {
    query['QosName'] = request.qosName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyQos',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyQos(request: ModifyQosRequest): ModifyQosResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyQosWithOptions(request, runtime);
}

model ModifyQosCarRequest {
  description?: string(name='Description', example='Qostest'),
  limitType?: string(name='LimitType', example='Absolute'),
  maxBandwidthAbs?: int32(name='MaxBandwidthAbs', example='6'),
  maxBandwidthPercent?: int32(name='MaxBandwidthPercent', example='90'),
  minBandwidthAbs?: int32(name='MinBandwidthAbs', example='2'),
  minBandwidthPercent?: int32(name='MinBandwidthPercent', example='20'),
  name?: string(name='Name', example='nametest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  percentSourceType?: string(name='PercentSourceType', example='CcnBandwidth'),
  priority?: int32(name='Priority', example='2'),
  qosCarId?: string(name='QosCarId', example='qoscar-n5k8g97lihlph****'),
  qosId?: string(name='QosId', example='qos-awfxl1adxeqyk****'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyQosCarResponseBody = {
  requestId?: string(name='RequestId', example='551CD836-9E46-4F2C-A167-B4363180A647'),
}

model ModifyQosCarResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyQosCarResponseBody(name='body'),
}

async function modifyQosCarWithOptions(request: ModifyQosCarRequest, runtime: Util.RuntimeOptions): ModifyQosCarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.limitType)) {
    query['LimitType'] = request.limitType;
  }
  if (!Util.isUnset(request.maxBandwidthAbs)) {
    query['MaxBandwidthAbs'] = request.maxBandwidthAbs;
  }
  if (!Util.isUnset(request.maxBandwidthPercent)) {
    query['MaxBandwidthPercent'] = request.maxBandwidthPercent;
  }
  if (!Util.isUnset(request.minBandwidthAbs)) {
    query['MinBandwidthAbs'] = request.minBandwidthAbs;
  }
  if (!Util.isUnset(request.minBandwidthPercent)) {
    query['MinBandwidthPercent'] = request.minBandwidthPercent;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.percentSourceType)) {
    query['PercentSourceType'] = request.percentSourceType;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.qosCarId)) {
    query['QosCarId'] = request.qosCarId;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyQosCar',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyQosCar(request: ModifyQosCarRequest): ModifyQosCarResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyQosCarWithOptions(request, runtime);
}

model ModifyQosPolicyRequest {
  description?: string(name='Description', example='desctest'),
  destCidr?: string(name='DestCidr', example='10.10.20.0/24'),
  destPortRange?: string(name='DestPortRange', example='300/400'),
  dpiGroupIds?: [ string ](name='DpiGroupIds', example='20'),
  dpiSignatureIds?: [ string ](name='DpiSignatureIds', example='1'),
  endTime?: string(name='EndTime', example='2019-09-14T16:41:33+0800'),
  ipProtocol?: string(name='IpProtocol', example='TCP'),
  name?: string(name='Name', example='nametest'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  priority?: int32(name='Priority', example='3'),
  qosId?: string(name='QosId', example='qos-xitd8690ucu8ro****'),
  qosPolicyId?: string(name='QosPolicyId', example='qospy-427m9fo6wkh****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sourceCidr?: string(name='SourceCidr', example='10.10.10.0/24'),
  sourcePortRange?: string(name='SourcePortRange', example='1/200'),
  startTime?: string(name='StartTime', example='2019-07-14T16:41:33+0800'),
}

model ModifyQosPolicyResponseBody = {
  requestId?: string(name='RequestId', example='551CD836-9E46-4F2C-A167-B4363180A647'),
}

model ModifyQosPolicyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyQosPolicyResponseBody(name='body'),
}

async function modifyQosPolicyWithOptions(request: ModifyQosPolicyRequest, runtime: Util.RuntimeOptions): ModifyQosPolicyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.destCidr)) {
    query['DestCidr'] = request.destCidr;
  }
  if (!Util.isUnset(request.destPortRange)) {
    query['DestPortRange'] = request.destPortRange;
  }
  if (!Util.isUnset(request.dpiGroupIds)) {
    query['DpiGroupIds'] = request.dpiGroupIds;
  }
  if (!Util.isUnset(request.dpiSignatureIds)) {
    query['DpiSignatureIds'] = request.dpiSignatureIds;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ipProtocol)) {
    query['IpProtocol'] = request.ipProtocol;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.qosId)) {
    query['QosId'] = request.qosId;
  }
  if (!Util.isUnset(request.qosPolicyId)) {
    query['QosPolicyId'] = request.qosPolicyId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sourceCidr)) {
    query['SourceCidr'] = request.sourceCidr;
  }
  if (!Util.isUnset(request.sourcePortRange)) {
    query['SourcePortRange'] = request.sourcePortRange;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyQosPolicy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyQosPolicy(request: ModifyQosPolicyRequest): ModifyQosPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyQosPolicyWithOptions(request, runtime);
}

model ModifyRouteDistributionStrategyRequest {
  destCidrBlock?: string(name='DestCidrBlock', example='172.XX.XX.0/24'),
  hcInstanceId?: string(name='HcInstanceId', example='hc-sztovuprqzgm50****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeDistribution?: string(name='RouteDistribution', example='publish'),
  routeSource?: string(name='RouteSource', example='OSPF'),
  smartAGId?: string(name='SmartAGId', example='sag-erx3qta5xg5zyq****'),
  sourceType?: string(name='SourceType', example='local'),
}

model ModifyRouteDistributionStrategyResponseBody = {
  requestId?: string(name='RequestId', example='24C58BD0-1679-4942-9D42-00B635DAAADB'),
}

model ModifyRouteDistributionStrategyResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyRouteDistributionStrategyResponseBody(name='body'),
}

async function modifyRouteDistributionStrategyWithOptions(request: ModifyRouteDistributionStrategyRequest, runtime: Util.RuntimeOptions): ModifyRouteDistributionStrategyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destCidrBlock)) {
    query['DestCidrBlock'] = request.destCidrBlock;
  }
  if (!Util.isUnset(request.hcInstanceId)) {
    query['HcInstanceId'] = request.hcInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeDistribution)) {
    query['RouteDistribution'] = request.routeDistribution;
  }
  if (!Util.isUnset(request.routeSource)) {
    query['RouteSource'] = request.routeSource;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.sourceType)) {
    query['SourceType'] = request.sourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyRouteDistributionStrategy',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyRouteDistributionStrategy(request: ModifyRouteDistributionStrategyRequest): ModifyRouteDistributionStrategyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyRouteDistributionStrategyWithOptions(request, runtime);
}

model ModifySAGAdminPasswordRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='********'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-tq3sazs17smldn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySAGAdminPasswordResponseBody = {
  requestId?: string(name='RequestId', example='DB0A026C-A8E5-40AB-977E-3A87DD78F694'),
}

model ModifySAGAdminPasswordResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySAGAdminPasswordResponseBody(name='body'),
}

async function modifySAGAdminPasswordWithOptions(request: ModifySAGAdminPasswordRequest, runtime: Util.RuntimeOptions): ModifySAGAdminPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySAGAdminPassword',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySAGAdminPassword(request: ModifySAGAdminPasswordRequest): ModifySAGAdminPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySAGAdminPasswordWithOptions(request, runtime);
}

model ModifySagExpressConnectInterfaceRequest {
  IP?: string(name='IP', example='192.XX.XX.1'),
  mask?: string(name='Mask', example='255.255.255.252'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='5'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='10'),
}

model ModifySagExpressConnectInterfaceResponseBody = {
  requestId?: string(name='RequestId', example='AFF7E5A6-6897-4FDC-A5A8-1978B5B3E545'),
}

model ModifySagExpressConnectInterfaceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagExpressConnectInterfaceResponseBody(name='body'),
}

async function modifySagExpressConnectInterfaceWithOptions(request: ModifySagExpressConnectInterfaceRequest, runtime: Util.RuntimeOptions): ModifySagExpressConnectInterfaceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.IP)) {
    query['IP'] = request.IP;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagExpressConnectInterface',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagExpressConnectInterface(request: ModifySagExpressConnectInterfaceRequest): ModifySagExpressConnectInterfaceResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagExpressConnectInterfaceWithOptions(request, runtime);
}

model ModifySagGlobalRouteProtocolRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeProtocol?: string(name='RouteProtocol', example='OSPF'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySagGlobalRouteProtocolResponseBody = {
  requestId?: string(name='RequestId', example='DB0A026C-A8E5-40AB-977E-3A87DD78F694'),
}

model ModifySagGlobalRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagGlobalRouteProtocolResponseBody(name='body'),
}

async function modifySagGlobalRouteProtocolWithOptions(request: ModifySagGlobalRouteProtocolRequest, runtime: Util.RuntimeOptions): ModifySagGlobalRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeProtocol)) {
    query['RouteProtocol'] = request.routeProtocol;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagGlobalRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagGlobalRouteProtocol(request: ModifySagGlobalRouteProtocolRequest): ModifySagGlobalRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagGlobalRouteProtocolWithOptions(request, runtime);
}

model ModifySagHaRequest {
  mode?: string(name='Mode', example='NONE'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='5'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  virtualIp?: string(name='VirtualIp', example='192.XX.XX.5'),
}

model ModifySagHaResponseBody = {
  requestId?: string(name='RequestId', example='3200E8A3-563F-4FFC-8BDB-0F1263FA69E8'),
}

model ModifySagHaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagHaResponseBody(name='body'),
}

async function modifySagHaWithOptions(request: ModifySagHaRequest, runtime: Util.RuntimeOptions): ModifySagHaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.virtualIp)) {
    query['VirtualIp'] = request.virtualIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagHa',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagHa(request: ModifySagHaRequest): ModifySagHaResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagHaWithOptions(request, runtime);
}

model ModifySagLanRequest {
  endIp?: string(name='EndIp', example='192.XX.XX.254'),
  IP?: string(name='IP', example='192.XX.XX.1'),
  IPType?: string(name='IPType', example='STATIC'),
  lease?: string(name='Lease', example='7'),
  mask?: string(name='Mask', example='255.255.255.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='0'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  startIp?: string(name='StartIp', example='192.XX.XX.2'),
}

model ModifySagLanResponseBody = {
  requestId?: string(name='RequestId', example='1120228A-E5E1-4E9C-B56D-96887E1A2B2F'),
}

model ModifySagLanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagLanResponseBody(name='body'),
}

async function modifySagLanWithOptions(request: ModifySagLanRequest, runtime: Util.RuntimeOptions): ModifySagLanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endIp)) {
    query['EndIp'] = request.endIp;
  }
  if (!Util.isUnset(request.IP)) {
    query['IP'] = request.IP;
  }
  if (!Util.isUnset(request.IPType)) {
    query['IPType'] = request.IPType;
  }
  if (!Util.isUnset(request.lease)) {
    query['Lease'] = request.lease;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.startIp)) {
    query['StartIp'] = request.startIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagLan',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagLan(request: ModifySagLanRequest): ModifySagLanResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagLanWithOptions(request, runtime);
}

model ModifySagManagementPortRequest {
  gateway?: string(name='Gateway', example='192.XX.XX.254'),
  IP?: string(name='IP', example='192.XX.XX.1'),
  mask?: string(name='Mask', example='255.255.255.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySagManagementPortResponseBody = {
  requestId?: string(name='RequestId', example='6877D55B-08F7-4DA3-916B-32A6FD402E06'),
}

model ModifySagManagementPortResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagManagementPortResponseBody(name='body'),
}

async function modifySagManagementPortWithOptions(request: ModifySagManagementPortRequest, runtime: Util.RuntimeOptions): ModifySagManagementPortResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.gateway)) {
    query['Gateway'] = request.gateway;
  }
  if (!Util.isUnset(request.IP)) {
    query['IP'] = request.IP;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagManagementPort',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagManagementPort(request: ModifySagManagementPortRequest): ModifySagManagementPortResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagManagementPortWithOptions(request, runtime);
}

model ModifySagPortRoleRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='0'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  role?: string(name='Role', example='NONE'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySagPortRoleResponseBody = {
  requestId?: string(name='RequestId', example='3200E8A3-563F-4FFC-8BDB-0F1263FA69E8'),
}

model ModifySagPortRoleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagPortRoleResponseBody(name='body'),
}

async function modifySagPortRoleWithOptions(request: ModifySagPortRoleRequest, runtime: Util.RuntimeOptions): ModifySagPortRoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.role)) {
    query['Role'] = request.role;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagPortRole',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagPortRole(request: ModifySagPortRoleRequest): ModifySagPortRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagPortRoleWithOptions(request, runtime);
}

model ModifySagPortRouteProtocolRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='2'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  remoteAs?: string(name='RemoteAs', example='65535'),
  remoteIp?: string(name='RemoteIp', example='192.XX.XX.1'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routeProtocol?: string(name='RouteProtocol', example='STATIC'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='2'),
}

model ModifySagPortRouteProtocolResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
}

model ModifySagPortRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagPortRouteProtocolResponseBody(name='body'),
}

async function modifySagPortRouteProtocolWithOptions(request: ModifySagPortRouteProtocolRequest, runtime: Util.RuntimeOptions): ModifySagPortRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.remoteAs)) {
    query['RemoteAs'] = request.remoteAs;
  }
  if (!Util.isUnset(request.remoteIp)) {
    query['RemoteIp'] = request.remoteIp;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routeProtocol)) {
    query['RouteProtocol'] = request.routeProtocol;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagPortRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagPortRouteProtocol(request: ModifySagPortRouteProtocolRequest): ModifySagPortRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagPortRouteProtocolWithOptions(request, runtime);
}

model ModifySagRemoteAccessRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  remoteAccessIp?: string(name='RemoteAccessIp', example='10.10.10.2'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sag-100-v1p7-9'),
  smartAGId?: string(name='SmartAGId', example='sag-r79m060r6oy55******'),
}

model ModifySagRemoteAccessResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='Successful'),
  remoteAccessIp?: string(name='RemoteAccessIp', example='10.10.10.2'),
  requestId?: string(name='RequestId', example='4FF203D7-462D-498E-94F9-2B2FA462DD23'),
  serialNumber?: string(name='SerialNumber', example='sag61a344**'),
  success?: boolean(name='Success', example='true'),
}

model ModifySagRemoteAccessResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagRemoteAccessResponseBody(name='body'),
}

async function modifySagRemoteAccessWithOptions(request: ModifySagRemoteAccessRequest, runtime: Util.RuntimeOptions): ModifySagRemoteAccessResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.remoteAccessIp)) {
    query['RemoteAccessIp'] = request.remoteAccessIp;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagRemoteAccess',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagRemoteAccess(request: ModifySagRemoteAccessRequest): ModifySagRemoteAccessResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagRemoteAccessWithOptions(request, runtime);
}

model ModifySagRouteProtocolBgpRequest {
  holdTime?: int32(name='HoldTime', example='9'),
  keepAlive?: int32(name='KeepAlive', example='3'),
  localAs?: long(name='LocalAs', example='65535'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routerId?: string(name='RouterId', example='172.XX.XX.1'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySagRouteProtocolBgpResponseBody = {
  requestId?: string(name='RequestId', example='48868976-45A2-4E87-B3AA-25089B8B7E49'),
}

model ModifySagRouteProtocolBgpResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagRouteProtocolBgpResponseBody(name='body'),
}

async function modifySagRouteProtocolBgpWithOptions(request: ModifySagRouteProtocolBgpRequest, runtime: Util.RuntimeOptions): ModifySagRouteProtocolBgpResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.holdTime)) {
    query['HoldTime'] = request.holdTime;
  }
  if (!Util.isUnset(request.keepAlive)) {
    query['KeepAlive'] = request.keepAlive;
  }
  if (!Util.isUnset(request.localAs)) {
    query['LocalAs'] = request.localAs;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routerId)) {
    query['RouterId'] = request.routerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagRouteProtocolBgp',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagRouteProtocolBgp(request: ModifySagRouteProtocolBgpRequest): ModifySagRouteProtocolBgpResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagRouteProtocolBgpWithOptions(request, runtime);
}

model ModifySagRouteProtocolOspfRequest {
  areaId?: int32(name='AreaId', example='86'),
  authenticationType?: string(name='AuthenticationType', example='NONE'),
  deadTime?: int32(name='DeadTime', example='10'),
  helloTime?: int32(name='HelloTime', example='3'),
  md5Key?: string(name='Md5Key', example='5'),
  md5KeyId?: int32(name='Md5KeyId', example='7'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='1212****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routerId?: string(name='RouterId', example='192.XX.XX.1'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30***'),
}

model ModifySagRouteProtocolOspfResponseBody = {
  requestId?: string(name='RequestId', example='191DC00D-00C0-475C-99B8-ADBB82496405'),
}

model ModifySagRouteProtocolOspfResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagRouteProtocolOspfResponseBody(name='body'),
}

async function modifySagRouteProtocolOspfWithOptions(request: ModifySagRouteProtocolOspfRequest, runtime: Util.RuntimeOptions): ModifySagRouteProtocolOspfResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.areaId)) {
    query['AreaId'] = request.areaId;
  }
  if (!Util.isUnset(request.authenticationType)) {
    query['AuthenticationType'] = request.authenticationType;
  }
  if (!Util.isUnset(request.deadTime)) {
    query['DeadTime'] = request.deadTime;
  }
  if (!Util.isUnset(request.helloTime)) {
    query['HelloTime'] = request.helloTime;
  }
  if (!Util.isUnset(request.md5Key)) {
    query['Md5Key'] = request.md5Key;
  }
  if (!Util.isUnset(request.md5KeyId)) {
    query['Md5KeyId'] = request.md5KeyId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routerId)) {
    query['RouterId'] = request.routerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagRouteProtocolOspf',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagRouteProtocolOspf(request: ModifySagRouteProtocolOspfRequest): ModifySagRouteProtocolOspfResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagRouteProtocolOspfWithOptions(request, runtime);
}

model ModifySagStaticRouteRequest {
  destinationCidr?: string(name='DestinationCidr', example='192.XX.XX.0/24'),
  nextHop?: string(name='NextHop', example='192.XX.XX.1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  portName?: string(name='PortName', example='0'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  vlan?: string(name='Vlan', example='1'),
}

model ModifySagStaticRouteResponseBody = {
  requestId?: string(name='RequestId', example='ACA5A9FE-77FA-4C09-980B-5C353160FA4A'),
}

model ModifySagStaticRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagStaticRouteResponseBody(name='body'),
}

async function modifySagStaticRouteWithOptions(request: ModifySagStaticRouteRequest, runtime: Util.RuntimeOptions): ModifySagStaticRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.destinationCidr)) {
    query['DestinationCidr'] = request.destinationCidr;
  }
  if (!Util.isUnset(request.nextHop)) {
    query['NextHop'] = request.nextHop;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagStaticRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagStaticRoute(request: ModifySagStaticRouteRequest): ModifySagStaticRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagStaticRouteWithOptions(request, runtime);
}

model ModifySagUserDnsRequest {
  masterDns?: string(name='MasterDns', example='192.XX.XX.1'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  slaveDns?: string(name='SlaveDns', example='192.XX.XX.2'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySagUserDnsResponseBody = {
  requestId?: string(name='RequestId', example='1120228A-E5E1-4E9C-B56D-96887E1A2B2F'),
}

model ModifySagUserDnsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagUserDnsResponseBody(name='body'),
}

async function modifySagUserDnsWithOptions(request: ModifySagUserDnsRequest, runtime: Util.RuntimeOptions): ModifySagUserDnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.masterDns)) {
    query['MasterDns'] = request.masterDns;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.slaveDns)) {
    query['SlaveDns'] = request.slaveDns;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagUserDns',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagUserDns(request: ModifySagUserDnsRequest): ModifySagUserDnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagUserDnsWithOptions(request, runtime);
}

model ModifySagWanRequest {
  bandwidth?: int32(name='Bandwidth', example='50'),
  gateway?: string(name='Gateway', example='192.XX.XX.254'),
  IP?: string(name='IP', example='192.XX.XX.1'),
  IPType?: string(name='IPType', example='DHCP'),
  ISP?: string(name='ISP', example='CT'),
  mask?: string(name='Mask', example='255.255.255.0'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='P12ppq***'),
  portName?: string(name='PortName', example='0'),
  priority?: int32(name='Priority', example='1'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  username?: string(name='Username', example='P12ppp***'),
  weight?: int32(name='Weight', example='100'),
}

model ModifySagWanResponseBody = {
  requestId?: string(name='RequestId', example='AFF7E5A6-6897-4FDC-A5A8-1978B5B3E545'),
}

model ModifySagWanResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagWanResponseBody(name='body'),
}

async function modifySagWanWithOptions(request: ModifySagWanRequest, runtime: Util.RuntimeOptions): ModifySagWanResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.gateway)) {
    query['Gateway'] = request.gateway;
  }
  if (!Util.isUnset(request.IP)) {
    query['IP'] = request.IP;
  }
  if (!Util.isUnset(request.IPType)) {
    query['IPType'] = request.IPType;
  }
  if (!Util.isUnset(request.ISP)) {
    query['ISP'] = request.ISP;
  }
  if (!Util.isUnset(request.mask)) {
    query['Mask'] = request.mask;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.priority)) {
    query['Priority'] = request.priority;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.username)) {
    query['Username'] = request.username;
  }
  if (!Util.isUnset(request.weight)) {
    query['Weight'] = request.weight;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagWan',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagWan(request: ModifySagWanRequest): ModifySagWanResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagWanWithOptions(request, runtime);
}

model ModifySagWanSnatRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
  snat?: string(name='Snat', example='ENABLE'),
}

model ModifySagWanSnatResponseBody = {
  requestId?: string(name='RequestId', example='96AF7326-B6DE-4188-8638-56A6164F62D9'),
}

model ModifySagWanSnatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagWanSnatResponseBody(name='body'),
}

async function modifySagWanSnatWithOptions(request: ModifySagWanSnatRequest, runtime: Util.RuntimeOptions): ModifySagWanSnatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  if (!Util.isUnset(request.snat)) {
    query['Snat'] = request.snat;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagWanSnat',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagWanSnat(request: ModifySagWanSnatRequest): ModifySagWanSnatResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagWanSnatWithOptions(request, runtime);
}

model ModifySagWifiRequest {
  authenticationType?: string(name='AuthenticationType', example='WPA2-PSK'),
  bandwidth?: string(name='Bandwidth'),
  channel?: string(name='Channel', example='0'),
  encryptAlgorithm?: string(name='EncryptAlgorithm', example='AUTO'),
  isAuth?: string(name='IsAuth', example='True'),
  isBroadcast?: string(name='IsBroadcast', example='True'),
  isEnable?: string(name='IsEnable', example='True'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='12345678'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  SSID?: string(name='SSID', example='aliyun_sag_123456****'),
  smartAGId?: string(name='SmartAGId', example='sag-whfn****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model ModifySagWifiResponseBody = {
  requestId?: string(name='RequestId', example='1120228A-E5E1-4E9C-B56D-96887E1A2B2F'),
}

model ModifySagWifiResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySagWifiResponseBody(name='body'),
}

async function modifySagWifiWithOptions(request: ModifySagWifiRequest, runtime: Util.RuntimeOptions): ModifySagWifiResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.authenticationType)) {
    query['AuthenticationType'] = request.authenticationType;
  }
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.channel)) {
    query['Channel'] = request.channel;
  }
  if (!Util.isUnset(request.encryptAlgorithm)) {
    query['EncryptAlgorithm'] = request.encryptAlgorithm;
  }
  if (!Util.isUnset(request.isAuth)) {
    query['IsAuth'] = request.isAuth;
  }
  if (!Util.isUnset(request.isBroadcast)) {
    query['IsBroadcast'] = request.isBroadcast;
  }
  if (!Util.isUnset(request.isEnable)) {
    query['IsEnable'] = request.isEnable;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.SSID)) {
    query['SSID'] = request.SSID;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySagWifi',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySagWifi(request: ModifySagWifiRequest): ModifySagWifiResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySagWifiWithOptions(request, runtime);
}

model ModifySmartAccessGatewayRequest {
  cidrBlock?: string(name='CidrBlock', example='172.16.0.0/24'),
  description?: string(name='Description'),
  enableSoftwareConnectionAudit?: boolean(name='EnableSoftwareConnectionAudit', example='true'),
  name?: string(name='Name', example='SAG'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  position?: string(name='Position'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  routingStrategy?: string(name='RoutingStrategy', example='static'),
  securityLockThreshold?: int32(name='SecurityLockThreshold', example='3'),
  smartAGId?: string(name='SmartAGId', example='sag-0ovhf732a9j0******'),
}

model ModifySmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
}

model ModifySmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySmartAccessGatewayResponseBody(name='body'),
}

async function modifySmartAccessGatewayWithOptions(request: ModifySmartAccessGatewayRequest, runtime: Util.RuntimeOptions): ModifySmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.cidrBlock)) {
    query['CidrBlock'] = request.cidrBlock;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.enableSoftwareConnectionAudit)) {
    query['EnableSoftwareConnectionAudit'] = request.enableSoftwareConnectionAudit;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.position)) {
    query['Position'] = request.position;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.routingStrategy)) {
    query['RoutingStrategy'] = request.routingStrategy;
  }
  if (!Util.isUnset(request.securityLockThreshold)) {
    query['SecurityLockThreshold'] = request.securityLockThreshold;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySmartAccessGateway(request: ModifySmartAccessGatewayRequest): ModifySmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySmartAccessGatewayWithOptions(request, runtime);
}

model ModifySmartAccessGatewayClientUserRequest {
  bandwidth?: int32(name='Bandwidth', example='1'),
  email?: string(name='Email', example='username@example.com'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-rz2e23c0e78ema****'),
  userName?: string(name='UserName', example='username'),
}

model ModifySmartAccessGatewayClientUserResponseBody = {
  bandwidth?: int32(name='Bandwidth', example='1'),
  clientIp?: string(name='ClientIp', example='10.10.10.1'),
  requestId?: string(name='RequestId', example='5F0078B5-8AAD-4B53-8351-4C91B8EA528A'),
  userMail?: string(name='UserMail', example='username@example.com'),
  userName?: string(name='UserName', example='username'),
}

model ModifySmartAccessGatewayClientUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySmartAccessGatewayClientUserResponseBody(name='body'),
}

async function modifySmartAccessGatewayClientUserWithOptions(request: ModifySmartAccessGatewayClientUserRequest, runtime: Util.RuntimeOptions): ModifySmartAccessGatewayClientUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySmartAccessGatewayClientUser',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySmartAccessGatewayClientUser(request: ModifySmartAccessGatewayClientUserRequest): ModifySmartAccessGatewayClientUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySmartAccessGatewayClientUserWithOptions(request, runtime);
}

model ModifySmartAccessGatewayUpBandwidthRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-jsy******************'),
  upBandwidth4G?: int32(name='UpBandwidth4G', example='3'),
  upBandwidthWan?: int32(name='UpBandwidthWan', example='2'),
}

model ModifySmartAccessGatewayUpBandwidthResponseBody = {
  requestId?: string(name='RequestId', example='EE837E9F-BD50-4C2B-9E47-260F9D848480'),
}

model ModifySmartAccessGatewayUpBandwidthResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifySmartAccessGatewayUpBandwidthResponseBody(name='body'),
}

async function modifySmartAccessGatewayUpBandwidthWithOptions(request: ModifySmartAccessGatewayUpBandwidthRequest, runtime: Util.RuntimeOptions): ModifySmartAccessGatewayUpBandwidthResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.upBandwidth4G)) {
    query['UpBandwidth4G'] = request.upBandwidth4G;
  }
  if (!Util.isUnset(request.upBandwidthWan)) {
    query['UpBandwidthWan'] = request.upBandwidthWan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifySmartAccessGatewayUpBandwidth',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifySmartAccessGatewayUpBandwidth(request: ModifySmartAccessGatewayUpBandwidthRequest): ModifySmartAccessGatewayUpBandwidthResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySmartAccessGatewayUpBandwidthWithOptions(request, runtime);
}

model MoveResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', example='rg-acfm2iu4fnc****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceId?: string(name='ResourceId', example='fl-g5w9ty0z36****'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType', example='flowlog'),
}

model MoveResourceGroupResponseBody = {
  requestId?: string(name='RequestId', example='6668829E-B261-4038-9EC6-0A2C57A14916'),
}

model MoveResourceGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MoveResourceGroupResponseBody(name='body'),
}

async function moveResourceGroupWithOptions(request: MoveResourceGroupRequest, runtime: Util.RuntimeOptions): MoveResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MoveResourceGroup',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function moveResourceGroup(request: MoveResourceGroupRequest): MoveResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return moveResourceGroupWithOptions(request, runtime);
}

model ProbeAccessPointNetworkQualityRequest {
  accessPointIds?: [ int32 ](name='AccessPointIds'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId'),
}

model ProbeAccessPointNetworkQualityResponseBody = {
  requestId?: string(name='RequestId'),
}

model ProbeAccessPointNetworkQualityResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ProbeAccessPointNetworkQualityResponseBody(name='body'),
}

async function probeAccessPointNetworkQualityWithOptions(request: ProbeAccessPointNetworkQualityRequest, runtime: Util.RuntimeOptions): ProbeAccessPointNetworkQualityResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPointIds)) {
    query['AccessPointIds'] = request.accessPointIds;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ProbeAccessPointNetworkQuality',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function probeAccessPointNetworkQuality(request: ProbeAccessPointNetworkQualityRequest): ProbeAccessPointNetworkQualityResponse {
  var runtime = new Util.RuntimeOptions{};
  return probeAccessPointNetworkQualityWithOptions(request, runtime);
}

model RebootSmartAccessGatewayRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='a1b2c3d4e5f6g7h8f9'),
  smartAGId?: string(name='SmartAGId', example='sag-w9unmktmupcde*****'),
}

model RebootSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='B1792769-5CC3-4D6F-A5A5-E6408EBFBAD0'),
}

model RebootSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RebootSmartAccessGatewayResponseBody(name='body'),
}

async function rebootSmartAccessGatewayWithOptions(request: RebootSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): RebootSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RebootSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function rebootSmartAccessGateway(request: RebootSmartAccessGatewayRequest): RebootSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return rebootSmartAccessGatewayWithOptions(request, runtime);
}

model ResetSmartAccessGatewayClientUserPasswordRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='Password****'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-kzo5dvms3dqii3****'),
  userName?: string(name='UserName', example='username'),
}

model ResetSmartAccessGatewayClientUserPasswordResponseBody = {
  requestId?: string(name='RequestId', example='BE1F7E80-4558-4021-B6D2-B94DA8AAAF81'),
}

model ResetSmartAccessGatewayClientUserPasswordResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResetSmartAccessGatewayClientUserPasswordResponseBody(name='body'),
}

async function resetSmartAccessGatewayClientUserPasswordWithOptions(request: ResetSmartAccessGatewayClientUserPasswordRequest, runtime: Util.RuntimeOptions): ResetSmartAccessGatewayClientUserPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetSmartAccessGatewayClientUserPassword',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetSmartAccessGatewayClientUserPassword(request: ResetSmartAccessGatewayClientUserPasswordRequest): ResetSmartAccessGatewayClientUserPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetSmartAccessGatewayClientUserPasswordWithOptions(request, runtime);
}

model RevokeInstanceFromCbnRequest {
  ccnInstanceId?: string(name='CcnInstanceId', example='ccn-n2935s1mnwv8i*****'),
  cenInstanceId?: string(name='CenInstanceId', example='cen-7qthudw0ll6jm*****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RevokeInstanceFromCbnResponseBody = {
  requestId?: string(name='RequestId', example='07D73949-2508-4169-8C64-7CCDB33871C4'),
}

model RevokeInstanceFromCbnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RevokeInstanceFromCbnResponseBody(name='body'),
}

async function revokeInstanceFromCbnWithOptions(request: RevokeInstanceFromCbnRequest, runtime: Util.RuntimeOptions): RevokeInstanceFromCbnResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnInstanceId)) {
    query['CcnInstanceId'] = request.ccnInstanceId;
  }
  if (!Util.isUnset(request.cenInstanceId)) {
    query['CenInstanceId'] = request.cenInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevokeInstanceFromCbn',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function revokeInstanceFromCbn(request: RevokeInstanceFromCbnRequest): RevokeInstanceFromCbnResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokeInstanceFromCbnWithOptions(request, runtime);
}

model RevokeInstanceFromVbrRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-0nnteglltw6z4b****'),
  vbrInstanceId?: string(name='VbrInstanceId', example='vbr-bp13gtbhdp0pfqg6s****'),
}

model RevokeInstanceFromVbrResponseBody = {
  requestId?: string(name='RequestId', example='D085AE49-51DC-4E8A-9F06-2D99C4E374F7'),
}

model RevokeInstanceFromVbrResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RevokeInstanceFromVbrResponseBody(name='body'),
}

async function revokeInstanceFromVbrWithOptions(request: RevokeInstanceFromVbrRequest, runtime: Util.RuntimeOptions): RevokeInstanceFromVbrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.vbrInstanceId)) {
    query['VbrInstanceId'] = request.vbrInstanceId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevokeInstanceFromVbr',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function revokeInstanceFromVbr(request: RevokeInstanceFromVbrRequest): RevokeInstanceFromVbrResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokeInstanceFromVbrWithOptions(request, runtime);
}

model RevokeSagInstanceFromCcnRequest {
  ccnInstanceId?: string(name='CcnInstanceId', example='ccn-jf********'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-hd**************'),
}

model RevokeSagInstanceFromCcnResponseBody = {
  requestId?: string(name='RequestId', example='BCB97739-0CB5-4C94-9A5C-13051FFAB0E9'),
}

model RevokeSagInstanceFromCcnResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RevokeSagInstanceFromCcnResponseBody(name='body'),
}

async function revokeSagInstanceFromCcnWithOptions(request: RevokeSagInstanceFromCcnRequest, runtime: Util.RuntimeOptions): RevokeSagInstanceFromCcnResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnInstanceId)) {
    query['CcnInstanceId'] = request.ccnInstanceId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RevokeSagInstanceFromCcn',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function revokeSagInstanceFromCcn(request: RevokeSagInstanceFromCcnRequest): RevokeSagInstanceFromCcnResponse {
  var runtime = new Util.RuntimeOptions{};
  return revokeSagInstanceFromCcnWithOptions(request, runtime);
}

model RoamClientUserRequest {
  originRegionId?: string(name='OriginRegionId', example='ap-southeast-2'),
  originSmartAGId?: string(name='OriginSmartAGId', example='sag-m9uhqekwnqcnyy****'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  targetSmartAGId?: string(name='TargetSmartAGId', example='sag-ghwa10ko6ndwug****'),
  userName?: string(name='UserName', example='nametest'),
}

model RoamClientUserResponseBody = {
  requestId?: string(name='RequestId', example='3200E8A3-563F-4FFC-8BDB-0F1263FA69E8'),
}

model RoamClientUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RoamClientUserResponseBody(name='body'),
}

async function roamClientUserWithOptions(request: RoamClientUserRequest, runtime: Util.RuntimeOptions): RoamClientUserResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.originRegionId)) {
    query['OriginRegionId'] = request.originRegionId;
  }
  if (!Util.isUnset(request.originSmartAGId)) {
    query['OriginSmartAGId'] = request.originSmartAGId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.targetSmartAGId)) {
    query['TargetSmartAGId'] = request.targetSmartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RoamClientUser',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function roamClientUser(request: RoamClientUserRequest): RoamClientUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return roamClientUserWithOptions(request, runtime);
}

model SetAdvancedMonitorStateRequest {
  enable?: boolean(name='Enable'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
}

model SetAdvancedMonitorStateResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model SetAdvancedMonitorStateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAdvancedMonitorStateResponseBody(name='body'),
}

async function setAdvancedMonitorStateWithOptions(request: SetAdvancedMonitorStateRequest, runtime: Util.RuntimeOptions): SetAdvancedMonitorStateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAdvancedMonitorState',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAdvancedMonitorState(request: SetAdvancedMonitorStateRequest): SetAdvancedMonitorStateResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAdvancedMonitorStateWithOptions(request, runtime);
}

model SynchronizeSmartAGWebConfigRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-nylv14tghsk26c****'),
  smartAGSn?: string(name='SmartAGSn', example='sag32a30****'),
}

model SynchronizeSmartAGWebConfigResponseBody = {
  requestId?: string(name='RequestId', example='CBBE5EBF-69C1-4395-B36B-26B7605F87EA'),
}

model SynchronizeSmartAGWebConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SynchronizeSmartAGWebConfigResponseBody(name='body'),
}

async function synchronizeSmartAGWebConfigWithOptions(request: SynchronizeSmartAGWebConfigRequest, runtime: Util.RuntimeOptions): SynchronizeSmartAGWebConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGSn)) {
    query['SmartAGSn'] = request.smartAGSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SynchronizeSmartAGWebConfig',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function synchronizeSmartAGWebConfig(request: SynchronizeSmartAGWebConfigRequest): SynchronizeSmartAGWebConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return synchronizeSmartAGWebConfigWithOptions(request, runtime);
}

model UnbindSerialNumberRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='cn-sh-0-0927-16****'),
  smartAGId?: string(name='SmartAGId', example='sag-0phdojgu5tqr1p****'),
}

model UnbindSerialNumberResponseBody = {
  requestId?: string(name='RequestId', example='284045DE-4C2D-463D-9F27-B6898E67D120'),
}

model UnbindSerialNumberResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnbindSerialNumberResponseBody(name='body'),
}

async function unbindSerialNumberWithOptions(request: UnbindSerialNumberRequest, runtime: Util.RuntimeOptions): UnbindSerialNumberResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindSerialNumber',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindSerialNumber(request: UnbindSerialNumberRequest): UnbindSerialNumberResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindSerialNumberWithOptions(request, runtime);
}

model UnbindSmartAccessGatewayRequest {
  ccnId?: string(name='CcnId', example='ccn-kygbldwikz********'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-0ovhf732a********'),
  smartAGUid?: long(name='SmartAGUid', example='1688401595963306'),
}

model UnbindSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
}

model UnbindSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnbindSmartAccessGatewayResponseBody(name='body'),
}

async function unbindSmartAccessGatewayWithOptions(request: UnbindSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): UnbindSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ccnId)) {
    query['CcnId'] = request.ccnId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGUid)) {
    query['SmartAGUid'] = request.smartAGUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindSmartAccessGateway(request: UnbindSmartAccessGatewayRequest): UnbindSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindSmartAccessGatewayWithOptions(request, runtime);
}

model UnbindVbrRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-pek29fu47tmpj0****'),
  smartAGUid?: long(name='SmartAGUid', example='253460731706911258'),
  vbrId?: string(name='VbrId', example='vbr-wz90rs6ef1m2fq0yn****'),
  vbrRegionId?: string(name='VbrRegionId', example='cn-hangzhou'),
}

model UnbindVbrResponseBody = {
  requestId?: string(name='RequestId', example='61C33444-D8C5-4018-A06C-BA8C8812BEF6'),
}

model UnbindVbrResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnbindVbrResponseBody(name='body'),
}

async function unbindVbrWithOptions(request: UnbindVbrRequest, runtime: Util.RuntimeOptions): UnbindVbrResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.smartAGUid)) {
    query['SmartAGUid'] = request.smartAGUid;
  }
  if (!Util.isUnset(request.vbrId)) {
    query['VbrId'] = request.vbrId;
  }
  if (!Util.isUnset(request.vbrRegionId)) {
    query['VbrRegionId'] = request.vbrRegionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnbindVbr',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unbindVbr(request: UnbindVbrRequest): UnbindVbrResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindVbrWithOptions(request, runtime);
}

model UnlockSmartAccessGatewayRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-w9unmktmupcde*****'),
}

model UnlockSmartAccessGatewayResponseBody = {
  requestId?: string(name='RequestId', example='05DC546B-DBF9-4028-88CD-1742AB4E014C'),
}

model UnlockSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnlockSmartAccessGatewayResponseBody(name='body'),
}

async function unlockSmartAccessGatewayWithOptions(request: UnlockSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): UnlockSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UnlockSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function unlockSmartAccessGateway(request: UnlockSmartAccessGatewayRequest): UnlockSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return unlockSmartAccessGatewayWithOptions(request, runtime);
}

model UpdateEnterpriseCodeRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4****'),
  enterpriseCode?: string(name='EnterpriseCode', example='12P**'),
  isDefault?: boolean(name='IsDefault', example='true'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
}

model UpdateEnterpriseCodeResponseBody = {
  requestId?: string(name='RequestId', example='FBDB18D8-E91E-4978-8D6C-6E2E3EE10133'),
}

model UpdateEnterpriseCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateEnterpriseCodeResponseBody(name='body'),
}

async function updateEnterpriseCodeWithOptions(request: UpdateEnterpriseCodeRequest, runtime: Util.RuntimeOptions): UpdateEnterpriseCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enterpriseCode)) {
    query['EnterpriseCode'] = request.enterpriseCode;
  }
  if (!Util.isUnset(request.isDefault)) {
    query['IsDefault'] = request.isDefault;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEnterpriseCode',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateEnterpriseCode(request: UpdateEnterpriseCodeRequest): UpdateEnterpriseCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateEnterpriseCodeWithOptions(request, runtime);
}

model UpdateProbeTaskRequest {
  domain?: string(name='Domain'),
  enable?: boolean(name='Enable'),
  packetNumber?: int32(name='PacketNumber'),
  port?: int32(name='Port'),
  probeTaskId?: string(name='ProbeTaskId'),
  probeTaskSourceAddress?: string(name='ProbeTaskSourceAddress'),
  protocol?: string(name='Protocol'),
  regionId?: string(name='RegionId'),
  sagId?: string(name='SagId'),
  sn?: string(name='Sn'),
  taskName?: string(name='TaskName'),
}

model UpdateProbeTaskResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UpdateProbeTaskResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateProbeTaskResponseBody(name='body'),
}

async function updateProbeTaskWithOptions(request: UpdateProbeTaskRequest, runtime: Util.RuntimeOptions): UpdateProbeTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.enable)) {
    query['Enable'] = request.enable;
  }
  if (!Util.isUnset(request.packetNumber)) {
    query['PacketNumber'] = request.packetNumber;
  }
  if (!Util.isUnset(request.port)) {
    query['Port'] = request.port;
  }
  if (!Util.isUnset(request.probeTaskId)) {
    query['ProbeTaskId'] = request.probeTaskId;
  }
  if (!Util.isUnset(request.probeTaskSourceAddress)) {
    query['ProbeTaskSourceAddress'] = request.probeTaskSourceAddress;
  }
  if (!Util.isUnset(request.protocol)) {
    query['Protocol'] = request.protocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagId)) {
    query['SagId'] = request.sagId;
  }
  if (!Util.isUnset(request.sn)) {
    query['Sn'] = request.sn;
  }
  if (!Util.isUnset(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProbeTask',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateProbeTask(request: UpdateProbeTaskRequest): UpdateProbeTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateProbeTaskWithOptions(request, runtime);
}

model UpdateSmartAGAccessPointRequest {
  accessPointId?: int32(name='AccessPointId', example='10'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-far8v6owtdxlua****'),
}

model UpdateSmartAGAccessPointResponseBody = {
  requestId?: string(name='RequestId', example='E26DBAAE-A796-4A48-98B4-B45AFCD1F299'),
}

model UpdateSmartAGAccessPointResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAGAccessPointResponseBody(name='body'),
}

async function updateSmartAGAccessPointWithOptions(request: UpdateSmartAGAccessPointRequest, runtime: Util.RuntimeOptions): UpdateSmartAGAccessPointResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accessPointId)) {
    query['AccessPointId'] = request.accessPointId;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAGAccessPoint',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAGAccessPoint(request: UpdateSmartAGAccessPointRequest): UpdateSmartAGAccessPointResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAGAccessPointWithOptions(request, runtime);
}

model UpdateSmartAGDpiAttributeRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4-130e****'),
  dpiEnabled?: boolean(name='DpiEnabled', example='true'),
  dryRun?: boolean(name='DryRun', example='false'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-tq3sazs17smldn****'),
}

model UpdateSmartAGDpiAttributeResponseBody = {
  requestId?: string(name='RequestId', example='0C2EE7A8-74D4-4081-8236-CEBDE3BBCF50'),
}

model UpdateSmartAGDpiAttributeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAGDpiAttributeResponseBody(name='body'),
}

async function updateSmartAGDpiAttributeWithOptions(request: UpdateSmartAGDpiAttributeRequest, runtime: Util.RuntimeOptions): UpdateSmartAGDpiAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dpiEnabled)) {
    query['DpiEnabled'] = request.dpiEnabled;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAGDpiAttribute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAGDpiAttribute(request: UpdateSmartAGDpiAttributeRequest): UpdateSmartAGDpiAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAGDpiAttributeWithOptions(request, runtime);
}

model UpdateSmartAGEnterpriseCodeRequest {
  clientToken?: string(name='ClientToken', example='02fb3da4-130e****'),
  enterpriseCode?: string(name='EnterpriseCode', example='12P**'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  smartAGId?: string(name='SmartAGId', example='sag-rz2e23c0e78ema****'),
}

model UpdateSmartAGEnterpriseCodeResponseBody = {
  requestId?: string(name='RequestId', example='FBDB18D8-E91E-4978-8D6C-6E2E3EE10133'),
}

model UpdateSmartAGEnterpriseCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAGEnterpriseCodeResponseBody(name='body'),
}

async function updateSmartAGEnterpriseCodeWithOptions(request: UpdateSmartAGEnterpriseCodeRequest, runtime: Util.RuntimeOptions): UpdateSmartAGEnterpriseCodeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.enterpriseCode)) {
    query['EnterpriseCode'] = request.enterpriseCode;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAGEnterpriseCode',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAGEnterpriseCode(request: UpdateSmartAGEnterpriseCodeRequest): UpdateSmartAGEnterpriseCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAGEnterpriseCodeWithOptions(request, runtime);
}

model UpdateSmartAGUserAccelerateConfigRequest {
  bandwidth?: int32(name='Bandwidth', example='1000'),
  clientToken?: string(name='ClientToken', example='02fb3da4-130e-11e9-8e44-001****'),
  dryRun?: boolean(name='DryRun', example='false'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  smartAGId?: string(name='SmartAGId', example='sag-w11hk4bqxpakem****'),
  userName?: string(name='UserName', example='username@example.com'),
}

model UpdateSmartAGUserAccelerateConfigResponseBody = {
  requestId?: string(name='RequestId', example='465B5F94-C7CF-4D54-803D-A7BEAC8545D6'),
}

model UpdateSmartAGUserAccelerateConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAGUserAccelerateConfigResponseBody(name='body'),
}

async function updateSmartAGUserAccelerateConfigWithOptions(request: UpdateSmartAGUserAccelerateConfigRequest, runtime: Util.RuntimeOptions): UpdateSmartAGUserAccelerateConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bandwidth)) {
    query['Bandwidth'] = request.bandwidth;
  }
  if (!Util.isUnset(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!Util.isUnset(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAGUserAccelerateConfig',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAGUserAccelerateConfig(request: UpdateSmartAGUserAccelerateConfigRequest): UpdateSmartAGUserAccelerateConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAGUserAccelerateConfigWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayAdminPasswordRequest {
  crossAccount?: boolean(name='CrossAccount'),
  password?: string(name='Password'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model UpdateSmartAccessGatewayAdminPasswordResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayAdminPasswordResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayAdminPasswordResponseBody(name='body'),
}

async function updateSmartAccessGatewayAdminPasswordWithOptions(request: UpdateSmartAccessGatewayAdminPasswordRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayAdminPasswordResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayAdminPassword',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayAdminPassword(request: UpdateSmartAccessGatewayAdminPasswordRequest): UpdateSmartAccessGatewayAdminPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayAdminPasswordWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayBgpRouteRequest {
  crossAccount?: boolean(name='CrossAccount'),
  holdTime?: int32(name='HoldTime'),
  keepAlive?: int32(name='KeepAlive'),
  localAs?: long(name='LocalAs'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  routerId?: string(name='RouterId'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model UpdateSmartAccessGatewayBgpRouteResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayBgpRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayBgpRouteResponseBody(name='body'),
}

async function updateSmartAccessGatewayBgpRouteWithOptions(request: UpdateSmartAccessGatewayBgpRouteRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayBgpRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.holdTime)) {
    query['HoldTime'] = request.holdTime;
  }
  if (!Util.isUnset(request.keepAlive)) {
    query['KeepAlive'] = request.keepAlive;
  }
  if (!Util.isUnset(request.localAs)) {
    query['LocalAs'] = request.localAs;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.routerId)) {
    query['RouterId'] = request.routerId;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayBgpRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayBgpRoute(request: UpdateSmartAccessGatewayBgpRouteRequest): UpdateSmartAccessGatewayBgpRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayBgpRouteWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayDnsRequest {
  crossAccount?: boolean(name='CrossAccount'),
  masterDns?: string(name='MasterDns'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
  slaveDns?: string(name='SlaveDns'),
}

model UpdateSmartAccessGatewayDnsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayDnsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayDnsResponseBody(name='body'),
}

async function updateSmartAccessGatewayDnsWithOptions(request: UpdateSmartAccessGatewayDnsRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayDnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.masterDns)) {
    query['MasterDns'] = request.masterDns;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  if (!Util.isUnset(request.slaveDns)) {
    query['SlaveDns'] = request.slaveDns;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayDns',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayDns(request: UpdateSmartAccessGatewayDnsRequest): UpdateSmartAccessGatewayDnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayDnsWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayDnsForwardRequest {
  domain?: string(name='Domain', example='www.aliyun.com'),
  instanceId?: string(name='InstanceId', example='sagv3dnsforward-nc7qabskj17werc7su'),
  masterIp?: string(name='MasterIp', example='114.114.114.114'),
  mode?: string(name='Mode', example='first'),
  outboundPortIndex?: int32(name='OutboundPortIndex', example='0'),
  outboundPortName?: string(name='OutboundPortName', example='eth0'),
  outboundPortType?: string(name='OutboundPortType', example='PhysicalPort'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  sagInsId?: string(name='SagInsId', example='sag-v9un1ccz22owd76lf8'),
  sagSn?: string(name='SagSn', example='sagf4dkqh78'),
  slaveIp?: string(name='SlaveIp', example='172.16.0.14'),
}

model UpdateSmartAccessGatewayDnsForwardResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: string(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='284045DE-4C2D-463D-9F27-B6898E67D120'),
  success?: string(name='Success', example='true'),
}

model UpdateSmartAccessGatewayDnsForwardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayDnsForwardResponseBody(name='body'),
}

async function updateSmartAccessGatewayDnsForwardWithOptions(request: UpdateSmartAccessGatewayDnsForwardRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayDnsForwardResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domain)) {
    query['Domain'] = request.domain;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.masterIp)) {
    query['MasterIp'] = request.masterIp;
  }
  if (!Util.isUnset(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.outboundPortIndex)) {
    query['OutboundPortIndex'] = request.outboundPortIndex;
  }
  if (!Util.isUnset(request.outboundPortName)) {
    query['OutboundPortName'] = request.outboundPortName;
  }
  if (!Util.isUnset(request.outboundPortType)) {
    query['OutboundPortType'] = request.outboundPortType;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  if (!Util.isUnset(request.slaveIp)) {
    query['SlaveIp'] = request.slaveIp;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayDnsForward',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayDnsForward(request: UpdateSmartAccessGatewayDnsForwardRequest): UpdateSmartAccessGatewayDnsForwardResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayDnsForwardWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayGlobalRouteProtocolRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  routeProtocol?: string(name='RouteProtocol'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model UpdateSmartAccessGatewayGlobalRouteProtocolResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayGlobalRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayGlobalRouteProtocolResponseBody(name='body'),
}

async function updateSmartAccessGatewayGlobalRouteProtocolWithOptions(request: UpdateSmartAccessGatewayGlobalRouteProtocolRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayGlobalRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.routeProtocol)) {
    query['RouteProtocol'] = request.routeProtocol;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayGlobalRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayGlobalRouteProtocol(request: UpdateSmartAccessGatewayGlobalRouteProtocolRequest): UpdateSmartAccessGatewayGlobalRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayGlobalRouteProtocolWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayOspfRouteRequest {
  areaId?: int32(name='AreaId'),
  authenticationType?: string(name='AuthenticationType'),
  crossAccount?: boolean(name='CrossAccount'),
  deadTime?: int32(name='DeadTime'),
  helloTime?: int32(name='HelloTime'),
  interfaceName?: string(name='InterfaceName'),
  md5Key?: string(name='Md5Key'),
  md5KeyId?: int32(name='Md5KeyId'),
  networks?: string(name='Networks'),
  ospfCost?: int32(name='OspfCost'),
  ospfNetworkType?: string(name='OspfNetworkType'),
  password?: string(name='Password'),
  redistributeProtocol?: string(name='RedistributeProtocol'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  routerId?: string(name='RouterId'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model UpdateSmartAccessGatewayOspfRouteResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayOspfRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayOspfRouteResponseBody(name='body'),
}

async function updateSmartAccessGatewayOspfRouteWithOptions(request: UpdateSmartAccessGatewayOspfRouteRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayOspfRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.areaId)) {
    query['AreaId'] = request.areaId;
  }
  if (!Util.isUnset(request.authenticationType)) {
    query['AuthenticationType'] = request.authenticationType;
  }
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.deadTime)) {
    query['DeadTime'] = request.deadTime;
  }
  if (!Util.isUnset(request.helloTime)) {
    query['HelloTime'] = request.helloTime;
  }
  if (!Util.isUnset(request.interfaceName)) {
    query['InterfaceName'] = request.interfaceName;
  }
  if (!Util.isUnset(request.md5Key)) {
    query['Md5Key'] = request.md5Key;
  }
  if (!Util.isUnset(request.md5KeyId)) {
    query['Md5KeyId'] = request.md5KeyId;
  }
  if (!Util.isUnset(request.networks)) {
    query['Networks'] = request.networks;
  }
  if (!Util.isUnset(request.ospfCost)) {
    query['OspfCost'] = request.ospfCost;
  }
  if (!Util.isUnset(request.ospfNetworkType)) {
    query['OspfNetworkType'] = request.ospfNetworkType;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.redistributeProtocol)) {
    query['RedistributeProtocol'] = request.redistributeProtocol;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.routerId)) {
    query['RouterId'] = request.routerId;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayOspfRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayOspfRoute(request: UpdateSmartAccessGatewayOspfRouteRequest): UpdateSmartAccessGatewayOspfRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayOspfRouteWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayPortRouteProtocolRequest {
  crossAccount?: boolean(name='CrossAccount'),
  portName?: string(name='PortName'),
  regionId?: string(name='RegionId'),
  remoteAs?: string(name='RemoteAs'),
  remoteIp?: string(name='RemoteIp'),
  resourceUid?: string(name='ResourceUid'),
  routeProtocol?: string(name='RouteProtocol'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
  vlan?: string(name='Vlan'),
}

model UpdateSmartAccessGatewayPortRouteProtocolResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayPortRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayPortRouteProtocolResponseBody(name='body'),
}

async function updateSmartAccessGatewayPortRouteProtocolWithOptions(request: UpdateSmartAccessGatewayPortRouteProtocolRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayPortRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.portName)) {
    query['PortName'] = request.portName;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.remoteAs)) {
    query['RemoteAs'] = request.remoteAs;
  }
  if (!Util.isUnset(request.remoteIp)) {
    query['RemoteIp'] = request.remoteIp;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.routeProtocol)) {
    query['RouteProtocol'] = request.routeProtocol;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  if (!Util.isUnset(request.vlan)) {
    query['Vlan'] = request.vlan;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayPortRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayPortRouteProtocol(request: UpdateSmartAccessGatewayPortRouteProtocolRequest): UpdateSmartAccessGatewayPortRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayPortRouteProtocolWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayVersionRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  serialNumber?: string(name='SerialNumber', example='sag233****'),
  smartAGId?: string(name='SmartAGId', example='sag-0ovhf732a9j*******'),
  versionCode?: string(name='VersionCode', example='1.0.1'),
  versionType?: string(name='VersionType', example='Device'),
}

model UpdateSmartAccessGatewayVersionResponseBody = {
  requestId?: string(name='RequestId', example='CE6642D4-21EB-4168-9BF9-F217953F9892'),
}

model UpdateSmartAccessGatewayVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayVersionResponseBody(name='body'),
}

async function updateSmartAccessGatewayVersionWithOptions(request: UpdateSmartAccessGatewayVersionRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayVersionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.serialNumber)) {
    query['SerialNumber'] = request.serialNumber;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.versionCode)) {
    query['VersionCode'] = request.versionCode;
  }
  if (!Util.isUnset(request.versionType)) {
    query['VersionType'] = request.versionType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayVersion',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayVersion(request: UpdateSmartAccessGatewayVersionRequest): UpdateSmartAccessGatewayVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayVersionWithOptions(request, runtime);
}

model UpdateSmartAccessGatewayWanSnatRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
  snat?: string(name='Snat'),
}

model UpdateSmartAccessGatewayWanSnatResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateSmartAccessGatewayWanSnatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateSmartAccessGatewayWanSnatResponseBody(name='body'),
}

async function updateSmartAccessGatewayWanSnatWithOptions(request: UpdateSmartAccessGatewayWanSnatRequest, runtime: Util.RuntimeOptions): UpdateSmartAccessGatewayWanSnatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  if (!Util.isUnset(request.snat)) {
    query['Snat'] = request.snat;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateSmartAccessGatewayWanSnat',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateSmartAccessGatewayWanSnat(request: UpdateSmartAccessGatewayWanSnatRequest): UpdateSmartAccessGatewayWanSnatResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateSmartAccessGatewayWanSnatWithOptions(request, runtime);
}

model UpgradeSmartAccessGatewayRequest {
  autoPay?: boolean(name='AutoPay', example='true'),
  bandWidthSpec?: long(name='BandWidthSpec', example='3'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-d3m51apgw4po******'),
}

model UpgradeSmartAccessGatewayResponseBody = {
  orderId?: string(name='OrderId', example='203384676330296'),
  requestId?: string(name='RequestId', example='45F07029-1783-4B2D-B4CE-45B9EAA58440'),
}

model UpgradeSmartAccessGatewayResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpgradeSmartAccessGatewayResponseBody(name='body'),
}

async function upgradeSmartAccessGatewayWithOptions(request: UpgradeSmartAccessGatewayRequest, runtime: Util.RuntimeOptions): UpgradeSmartAccessGatewayResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.bandWidthSpec)) {
    query['BandWidthSpec'] = request.bandWidthSpec;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeSmartAccessGateway',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function upgradeSmartAccessGateway(request: UpgradeSmartAccessGatewayRequest): UpgradeSmartAccessGatewayResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeSmartAccessGatewayWithOptions(request, runtime);
}

model UpgradeSmartAccessGatewaySoftwareRequest {
  autoPay?: boolean(name='AutoPay', example='true'),
  dataPlan?: long(name='DataPlan', example='5'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId', example='cn-shanghai'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  smartAGId?: string(name='SmartAGId', example='sag-8biez7habqwmx6****'),
  userCount?: int32(name='UserCount', example='5'),
}

model UpgradeSmartAccessGatewaySoftwareResponseBody = {
  orderId?: string(name='OrderId', example='20697688135****'),
  requestId?: string(name='RequestId', example='97A4F8A5-603E-4C3B-A91E-17CD87090EA9'),
}

model UpgradeSmartAccessGatewaySoftwareResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpgradeSmartAccessGatewaySoftwareResponseBody(name='body'),
}

async function upgradeSmartAccessGatewaySoftwareWithOptions(request: UpgradeSmartAccessGatewaySoftwareRequest, runtime: Util.RuntimeOptions): UpgradeSmartAccessGatewaySoftwareResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.autoPay)) {
    query['AutoPay'] = request.autoPay;
  }
  if (!Util.isUnset(request.dataPlan)) {
    query['DataPlan'] = request.dataPlan;
  }
  if (!Util.isUnset(request.ownerAccount)) {
    query['OwnerAccount'] = request.ownerAccount;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.smartAGId)) {
    query['SmartAGId'] = request.smartAGId;
  }
  if (!Util.isUnset(request.userCount)) {
    query['UserCount'] = request.userCount;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeSmartAccessGatewaySoftware',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function upgradeSmartAccessGatewaySoftware(request: UpgradeSmartAccessGatewaySoftwareRequest): UpgradeSmartAccessGatewaySoftwareResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeSmartAccessGatewaySoftwareWithOptions(request, runtime);
}

model ViewSmartAccessGatewayBgpRouteRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayBgpRouteResponseBody = {
  holdTime?: int32(name='HoldTime'),
  keepAlive?: int32(name='KeepAlive'),
  localAs?: int32(name='LocalAs'),
  requestId?: string(name='RequestId'),
  routerId?: string(name='RouterId'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime'),
      errorCode?: string(name='ErrorCode'),
      errorMessage?: string(name='ErrorMessage'),
      state?: string(name='State'),
    }
  ](name='TaskStates'),
}

model ViewSmartAccessGatewayBgpRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayBgpRouteResponseBody(name='body'),
}

async function viewSmartAccessGatewayBgpRouteWithOptions(request: ViewSmartAccessGatewayBgpRouteRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayBgpRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayBgpRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayBgpRoute(request: ViewSmartAccessGatewayBgpRouteRequest): ViewSmartAccessGatewayBgpRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayBgpRouteWithOptions(request, runtime);
}

model ViewSmartAccessGatewayDnsRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayDnsResponseBody = {
  masterDns?: string(name='MasterDns'),
  requestId?: string(name='RequestId'),
  slaveDns?: string(name='SlaveDns'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime'),
      errorCode?: string(name='ErrorCode'),
      errorMessage?: string(name='ErrorMessage'),
      state?: string(name='State'),
    }
  ](name='TaskStates'),
}

model ViewSmartAccessGatewayDnsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayDnsResponseBody(name='body'),
}

async function viewSmartAccessGatewayDnsWithOptions(request: ViewSmartAccessGatewayDnsRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayDnsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayDns',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayDns(request: ViewSmartAccessGatewayDnsRequest): ViewSmartAccessGatewayDnsResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayDnsWithOptions(request, runtime);
}

model ViewSmartAccessGatewayDnsForwardsRequest {
  regionId?: string(name='RegionId', example='cn-shanghai'),
  sagInsId?: string(name='SagInsId', example='sag-v9un1ccz22owd76lf8'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayDnsForwardsResponseBody = {
  code?: string(name='Code', example='200'),
  count?: int32(name='Count', example='1914'),
  data?: [ 
    {
      domain?: string(name='Domain', example='www.baidu.com'),
      instanceId?: string(name='InstanceId', example='sagv3dnsforward-nc7qabskj17werc7su'),
      masterIp?: string(name='MasterIp', example='172.16.58.20'),
      mode?: string(name='Mode', example='first'),
      outboundPortIndex?: int32(name='OutboundPortIndex', example='0'),
      outboundPortName?: string(name='OutboundPortName', example='eth0'),
      outboundPortType?: string(name='OutboundPortType', example='PhysicalPort'),
      slaveIp?: string(name='SlaveIp', example='172.16.0.14'),
    }
  ](name='Data'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='Successful'),
  requestId?: string(name='RequestId', description='Id of the request', example='E223E535-AE11-4158-B00F-DC107887A909'),
  success?: boolean(name='Success', example='true'),
}

model ViewSmartAccessGatewayDnsForwardsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayDnsForwardsResponseBody(name='body'),
}

async function viewSmartAccessGatewayDnsForwardsWithOptions(request: ViewSmartAccessGatewayDnsForwardsRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayDnsForwardsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayDnsForwards',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayDnsForwards(request: ViewSmartAccessGatewayDnsForwardsRequest): ViewSmartAccessGatewayDnsForwardsResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayDnsForwardsWithOptions(request, runtime);
}

model ViewSmartAccessGatewayGlobalRouteProtocolRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayGlobalRouteProtocolResponseBody = {
  requestId?: string(name='RequestId'),
  routeProtocol?: string(name='RouteProtocol'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime'),
      errorCode?: string(name='ErrorCode'),
      errorMessage?: string(name='ErrorMessage'),
      state?: string(name='State'),
    }
  ](name='TaskStates'),
}

model ViewSmartAccessGatewayGlobalRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayGlobalRouteProtocolResponseBody(name='body'),
}

async function viewSmartAccessGatewayGlobalRouteProtocolWithOptions(request: ViewSmartAccessGatewayGlobalRouteProtocolRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayGlobalRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayGlobalRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayGlobalRouteProtocol(request: ViewSmartAccessGatewayGlobalRouteProtocolRequest): ViewSmartAccessGatewayGlobalRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayGlobalRouteProtocolWithOptions(request, runtime);
}

model ViewSmartAccessGatewayOspfRouteRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayOspfRouteResponseBody = {
  areaId?: int32(name='AreaId'),
  authenticationType?: string(name='AuthenticationType'),
  deadTime?: int32(name='DeadTime'),
  helloTime?: int32(name='HelloTime'),
  md5Key?: string(name='Md5Key'),
  md5KeyId?: int32(name='Md5KeyId'),
  requestId?: string(name='RequestId'),
  routerId?: string(name='RouterId'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime'),
      errorCode?: string(name='ErrorCode'),
      errorMessage?: string(name='ErrorMessage'),
      state?: string(name='State'),
    }
  ](name='TaskStates'),
}

model ViewSmartAccessGatewayOspfRouteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayOspfRouteResponseBody(name='body'),
}

async function viewSmartAccessGatewayOspfRouteWithOptions(request: ViewSmartAccessGatewayOspfRouteRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayOspfRouteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayOspfRoute',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayOspfRoute(request: ViewSmartAccessGatewayOspfRouteRequest): ViewSmartAccessGatewayOspfRouteResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayOspfRouteWithOptions(request, runtime);
}

model ViewSmartAccessGatewayPortRouteProtocolRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayPortRouteProtocolResponseBody = {
  ports?: [ 
    {
      neighborIp?: string(name='NeighborIp'),
      portName?: string(name='PortName'),
      remoteAs?: string(name='RemoteAs'),
      remoteIp?: string(name='RemoteIp'),
      routeProtocol?: string(name='RouteProtocol'),
      status?: string(name='Status'),
      vlan?: string(name='Vlan'),
    }
  ](name='Ports'),
  requestId?: string(name='RequestId'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime'),
      errorCode?: string(name='ErrorCode'),
      errorMessage?: string(name='ErrorMessage'),
      state?: string(name='State'),
    }
  ](name='TaskStates'),
}

model ViewSmartAccessGatewayPortRouteProtocolResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayPortRouteProtocolResponseBody(name='body'),
}

async function viewSmartAccessGatewayPortRouteProtocolWithOptions(request: ViewSmartAccessGatewayPortRouteProtocolRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayPortRouteProtocolResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayPortRouteProtocol',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayPortRouteProtocol(request: ViewSmartAccessGatewayPortRouteProtocolRequest): ViewSmartAccessGatewayPortRouteProtocolResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayPortRouteProtocolWithOptions(request, runtime);
}

model ViewSmartAccessGatewayRoutesRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayRoutesResponseBody = {
  requestId?: string(name='RequestId'),
  routes?: [ 
    {
      conflictCidrs?: [ string ](name='ConflictCidrs'),
      cost?: string(name='Cost'),
      dst?: string(name='Dst'),
      idx?: int32(name='Idx'),
      nexthop?: string(name='Nexthop'),
      role?: string(name='Role'),
      type?: string(name='Type'),
    }
  ](name='Routes'),
}

model ViewSmartAccessGatewayRoutesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayRoutesResponseBody(name='body'),
}

async function viewSmartAccessGatewayRoutesWithOptions(request: ViewSmartAccessGatewayRoutesRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayRoutesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayRoutes',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayRoutes(request: ViewSmartAccessGatewayRoutesRequest): ViewSmartAccessGatewayRoutesResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayRoutesWithOptions(request, runtime);
}

model ViewSmartAccessGatewayWanSnatRequest {
  crossAccount?: boolean(name='CrossAccount'),
  regionId?: string(name='RegionId'),
  resourceUid?: string(name='ResourceUid'),
  sagInsId?: string(name='SagInsId'),
  sagSn?: string(name='SagSn'),
}

model ViewSmartAccessGatewayWanSnatResponseBody = {
  requestId?: string(name='RequestId'),
  snat?: string(name='Snat'),
  taskStates?: [ 
    {
      createTime?: string(name='CreateTime'),
      errorCode?: string(name='ErrorCode'),
      errorMessage?: string(name='ErrorMessage'),
      state?: string(name='State'),
    }
  ](name='TaskStates'),
}

model ViewSmartAccessGatewayWanSnatResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ViewSmartAccessGatewayWanSnatResponseBody(name='body'),
}

async function viewSmartAccessGatewayWanSnatWithOptions(request: ViewSmartAccessGatewayWanSnatRequest, runtime: Util.RuntimeOptions): ViewSmartAccessGatewayWanSnatResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.crossAccount)) {
    query['CrossAccount'] = request.crossAccount;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceUid)) {
    query['ResourceUid'] = request.resourceUid;
  }
  if (!Util.isUnset(request.sagInsId)) {
    query['SagInsId'] = request.sagInsId;
  }
  if (!Util.isUnset(request.sagSn)) {
    query['SagSn'] = request.sagSn;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ViewSmartAccessGatewayWanSnat',
    version = '2018-03-13',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function viewSmartAccessGatewayWanSnat(request: ViewSmartAccessGatewayWanSnatRequest): ViewSmartAccessGatewayWanSnatResponse {
  var runtime = new Util.RuntimeOptions{};
  return viewSmartAccessGatewayWanSnatWithOptions(request, runtime);
}

